Soap header namespace

Posted by Admin on 13-Mar-2008 06:23

When I send a specific soap request with an added header I get

Error sending Web Service Request: HeaderEntry does not contain a local name or namespace URI (11767).

The knowledgebase doesn't say anything in perticular about this.

This is my code for adding the header:

PROCEDURE requestHeader:

DEFINE OUTPUT PARAMETER hSOAPHeader AS HANDLE.

DEFINE INPUT PARAMETER cOperationNamespace AS CHARACTER.

DEFINE INPUT PARAMETER cOperationLocalName AS CHARACTER.

DEFINE OUTPUT PARAMETER lDeleteOnDone AS LOGICAL.

DEFINE VARIABLE hTmpSoapHeader AS HANDLE NO-UNDO.

DEFINE VARIABLE hSoapHeaderRef AS HANDLE NO-UNDO.

DEFINE VARIABLE hSessionDoc AS HANDLE NO-UNDO.

DEFINE VARIABLE hSessionNode AS HANDLE NO-UNDO.

DEFINE VARIABLE hSessionValue AS HANDLE NO-UNDO.

CREATE SOAP-HEADER hTmpSoapHeader.

CREATE SOAP-HEADER-ENTRYREF hSoapHeaderRef.

CREATE X-DOCUMENT hSessionDoc .

CREATE X-NODEREF hSessionNode.

CREATE X-NODEREF hSessionValue.

hTmpSoapHeader:ADD-HEADER-ENTRY(hSoapHeaderRef).

hSessionDoc:CREATE-NODE(hSessionNode, "SessionID", "ELEMENT").

hSessionDoc:CREATE-NODE(hSessionValue, "", "TEXT").

hSessionValue:NODE-VALUE = cSessionID.

hSessionNode:APPEND-CHILD( hSessionValue ).

hSoapHeaderRef:SET-NODE(hSessionNode).

hSoapHeader = hTmpSoapHeader.

END PROCEDURE.

This is how the header should look:

As I understand this error the part xmlns="http://webservices.amadeus.com/definitions" is missing. And according to progress documentation the NAMESPACE-URI cannot be set but only read on soap-header-entryref object. What am I missing?

All Replies

Posted by Admin on 13-Mar-2008 10:15

I've found out that replacing

hSessionDoc:CREATE-NODE(hSessionNode, "SessionID", "ELEMENT").

with

hSessionDoc:CREATE-NODE-NAMESPACE(hSessionNode, "http://webservices.amadeus.com/definitions", "SessionID", "ELEMENT").

takes away the error message but something is still wrong. How can I verify how the header really looks?

Posted by Robin Brown on 14-Mar-2008 08:45

You can look at the SOAP messages using the SOAP Spy tool. Start the ABL client with -proxyhost localhost -proxyport 4444. Run SOAP Spy from a proenv session with the 'prosoapview' command then start spying with Spy->Start Spying. The SOAP messages will now go through SOAP Spy and get forwarded to the Web service.

Posted by Admin on 14-Mar-2008 08:52

Thanks a bunch!

I managed to work around this by getting the soap-header handle from the Signin response and just applying it to the following requests.

Nice to know that there's a SOAP Spy in progress though - I've been searching for one....

Posted by Admin on 17-Oct-2009 11:42

Hi,

Is it SOAP SPY or SPY SOAP, the software you mention in your reply? A Google search returns some untrusted Web sites plenty of Spy SOAP but none with the SOAP Spy. I just dodn't want to download the wrong software.


Thanks.

Salvo

Posted by Robin Brown on 19-Oct-2009 09:33

Hi Salvatore,

I was referring to the SOAP Spy tool that comes with an OpenEdge installation.  You can get to it with the 'prosoapview' command in a proenv window.  I have also used the Trace utility from the Microsoft SOAP Toolkit 3.0, and colleagues of mine use TCPMonitor available for download from Apache.

Regards,

Robin

Posted by Admin on 20-Oct-2009 12:47

http://communities.progress.com/pcom/message/71459#71459

Thanks Robin.

I now understand. I don't have OpenEdge installed but I use wsi-test-tools, which I believe provides similar features. Anyway, good to know it.

Regards.

Salvo

This thread is closed