Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Problems with SOAP messages, Axis, Java client and .NET web service

843833Oct 8 2008 — edited Jan 12 2010
Hi, everybody! I have an issue with Java and a web service developed using .NET (C#) (provided by a third-party vendor).
I tried to use axis for creating stub classes and using a Java client to access this web service. So having Eclipse 3.3 and JDK 1.6, I downloaded Axis 1.4 first and later Axis2 1.3, and I got all the code necessary for this Java client to communicate to the web service (using wsdl2java tool). But in all cases the exception I got was the same: A problem with a mustUnderstand header. The thing is the SOAP message for the request doesn't even have a header, as I could see with a handler class I wrote to process the messages.

To add details, I will show you the exception trace:

Exception in thread "main" AxisFault
faultCode: {http://www.w3.org/2003/05/soap-envelope}MustUnderstand
faultSubcode:
faultString: Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}stackTrace:
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.tempuri.TransportProviderStub.checkState(TransportProviderStub.java:1670)
at SmartSourceClient.main(SmartSourceClient.java:24)

{http://xml.apache.org/axis/}hostname:comwkgin107

Did not understand "MustUnderstand" header(s):{http://www.w3.org/2005/08/addressing}Action
at org.apache.axis.handlers.soap.MustUnderstandChecker.invoke(MustUnderstandChecker.java:96)
at org.apache.axis.client.AxisClient.invoke(AxisClient.java:206)
at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
at org.apache.axis.client.Call.invoke(Call.java:2767)
at org.apache.axis.client.Call.invoke(Call.java:2443)
at org.apache.axis.client.Call.invoke(Call.java:2366)
at org.apache.axis.client.Call.invoke(Call.java:1812)
at org.tempuri.TransportProviderStub.checkState(TransportProviderStub.java:1670)
at SmartSourceClient.main(SmartSourceClient.java:24)

The SOAP messages for the request and the response:

Request

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<soapenv:Envelope xmlns:soapenv="http://www.w3.org/2003/05/soap-envelope" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<CheckState xmlns="urn:schemas-paymentsystems-unisys-com:WebDeviceService:2008-01-01"/>
</soapenv:Body>
</soapenv:Envelope>

Response

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing">
<s:Header>
<a:Action s:mustUnderstand="1">http://www.w3.org/2005/08/addressing/fault</a:Action>
</s:Header>
<s:Body>
<s:Fault>
<s:Code>
<s:Value>s:Sender</s:Value>
<s:Subcode>
<s:Value>a:MessageAddressingHeaderRequired</s:Value>
</s:Subcode>
</s:Code>
<s:Reason>
<s:Text xml:lang="es-ES">No se encontró ningún encabezado de acción con el espacio de nombres 'http://www.w3.org/2005/08/addressing' para el mensaje indicado.</s:Text>
</s:Reason>
<s:Detail>
<a:ProblemHeaderQName>a:Action</a:ProblemHeaderQName>
</s:Detail>
</s:Fault>
</s:Body>
</s:Envelope>

The thing is that I'm somewhat newbie with using Web Services with Java. As I can see, this response must indicate a problem for the web service understanding the request, so the mustUnderstand header stuff, must refer to the request, but the request message has no header! Am I right? Also, almost all the code is generated, the only code I wrote is for calling the methods and the handler class, which only takes the message and prints it in the standard output.

I hope I have explained this clear enough for you to get the point. How could I solve it? Thanks in advance for your help!

Edited by: AlexRF on Oct 8, 2008 1:19 PM

Edited by: AlexRF on Oct 8, 2008 1:23 PM
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 9 2010
Added on Oct 8 2008
3 comments
1,718 views