unable to send SOAP Message

Poster Content
nk4um User
Posts: 8
February 5, 2009 17:31found the problem(s)
when I was calling the active:SOAPClient module I was passing the message as a DOMAspect.  If I change that to a StringAspect, then the namespace check works.  I would be grateful if you can explain that.  The other problem I discovered is that the active:SOAPClient module is not using the proxy configured in Netkernel.  In fact it is not setting a proxy at all.  I looked at the http module and that one is setting the proxy. 
So I will be using the StringAspect and fixing the active:SOAPClient module to set the correct proxy and see if that works.  I think atleast the proxy piece is a bug, let me know if I should log it in Bugxter.
Like · Post Reply
nk4um Moderator
Posts: 901
February 5, 2009 09:06Document Element Namespace, Envelope
Hi mpone,

NK base classloader (and therefore the soap module) uses the endorsed Xerces DOM found in the [install]lib/endorsed/

I just looked at the source and we step to the document element and look at its namespace URI. It must be one of these...

/*SOAP version namespaces*/
    public static final String SOAP_1_1_NAMESPACE="http://schemas.xmlsoap.org/soap/envelope/";
    public static final String SOAP_1_2_NAMESPACE="http://www.w3.org/2003/05/soap-envelope";

The Xerces DOM has been well proven so I would be surprised if it were a problem down there.  Best thing is to run with Java debugger and put a break point on the getNamespaceURI() and see if what your providing is definitely right.

Actually I just reread your posting.  There is a weirdness in DOM that it is possible to create an element that you think is in a namespace but was added in a way that it didn''t have the URI set.  Are you constructing the message by hand in the DOM domain?  If so see next para...

The SOAP client does require a complete well-formed message - so it does need the envelope etc.  However you can construct a well formed soap message template with active:newSOAPMessage12.  You can then manipulate the message with the header and body tools provided in the library.  This should make slicing, dicing and composing messages fairly pain free.



PS I''m currently looking at porting the SOAP infrastructure to NK4 so this is timely.   Let me know how you get on.
Like · Post Reply
nk4um User
Posts: 8
February 4, 2009 16:49unable to send SOAP Message
I am using the active:SOAPClient module to send a SOAP message.  The problem is that the SOAPHTTPBindingClient in the mod-ws-1.1.2 module, takes the message as a DOM object and tries to get the SOAP namespace.  The call
   String envNamespace=n.getNamespaceURI();

is trying to retrieve the SOAP version of the message being sent and is isreturning null, when applied to the document node, so it is unable to determine the SOAP version of the message.  My feeling is that this is a problem with the DOM implementation.  I am wondering if any one has ideas or if I should try swapping out DOM implementations to see if that makes a difference.  Also, do I need to include the SOAP envelope when sending my message or does the SOAPClient add the correct SOAP wrapper for my message?

Here is my SOAP xml message :

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:spot="http://www.spotzer.com/">
<ProductID>40261890</ProductID><ProductType>50</ProductType><CompanyName>RICHARDS LLP</CompanyName><ContactFirstName>TestClient</ContactFirstName>

Like · Post Reply