Custom faultcode using Axis2 - web-services

I've created a webservice and used Axis2 to generate all "skeleton" java classes. Then I of course implemented the service operations myself.
In the implementation, I can throw a MyException which is then caught by the generated classes and converted to an AxisFault object, which in turn is converted to a soap fault (deep down in the Axis framework) with the attribute <faultcode>soapenv:Server</faultcode>
My problem is I would like a custom dynamic faultcode, not "soapenv:Server".
I tried to manually create an AxisFault object and throw this, but AxisFault is a RemoteException, and the generated interface which my implementation must implement, does not allow to throw RemoteException.
Is it possible to get some kind of hook or filter on the output, so that I can change the faultcode? Or any other way to control the faultcode?
Thanks in advance
Ulrik

The SOAP specification describes how custom fault information appears under the detail tag. The faultcode is a fixed set of value dealing with where in the SOAP processing the error was thrown.
The following is an example of throwing a custom fault message
WSDL
Declare the faults in your WSDL so that the associated classes are generated:
<wsdl:definitions targetNamespace="http://example"
xmlns:apachesoap="http://xml.apache.org/xml-soap" xmlns:tns="http://example"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<schema elementFormDefault="qualified" targetNamespace="http://example"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:tns="http://example" xmlns:intf="http://example"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/">
<element name="withdraw">
<complexType>
<sequence>
<element name="account" type="xsd:string"/>
<element name="amount" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="withdrawResponse">
<complexType>
<sequence>
<element name="balance" type="xsd:int"/>
</sequence>
</complexType>
</element>
<element name="AccountNotExistFault">
<complexType>
<sequence>
<element name="account" type="xsd:string"/>
</sequence>
</complexType>
</element>
<element name="InsufficientFundFault">
<complexType>
<sequence>
<element name="account" type="xsd:string"/>
<element name="balance" type="xsd:int"/>
<element name="requestedFund" type="xsd:int"/>
</sequence>
</complexType>
</element>
</schema>
</wsdl:types>
<wsdl:message name="withdrawRequest">
<wsdl:part element="tns:withdraw" name="parameters"/>
</wsdl:message>
<wsdl:message name="withdrawResponse">
<wsdl:part element="tns:withdrawResponse" name="return"/>
</wsdl:message>
<wsdl:message name="InsufficientFundFaultMessage">
<wsdl:part element="tns:InsufficientFundFault" name="fault"/>
</wsdl:message>
<wsdl:message name="AccountNotExistFaultMessage">
<wsdl:part element="tns:AccountNotExistFault" name="fault"/>
</wsdl:message>
<wsdl:portType name="Bank">
<wsdl:operation name="withdraw">
<wsdl:input message="tns:withdrawRequest" name="withdrawRequest"/>
<wsdl:output message="tns:withdrawResponse" name="withdrawResponse"/>
<wsdl:fault message="tns:AccountNotExistFaultMessage" name="AccountNotExistException"/>
<wsdl:fault message="tns:InsufficientFundFaultMessage" name="InsufficientFundException"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="BankSoapBinding" type="tns:Bank">
<wsdlsoap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="withdraw">
<wsdlsoap:operation soapAction=""/>
<wsdl:input name="withdrawRequest">
<wsdlsoap:body use="literal"/>
</wsdl:input>
<wsdl:output name="withdrawResponse">
<wsdlsoap:body use="literal"/>
</wsdl:output>
<wsdl:fault name="InsufficientFundException">
<wsdlsoap:fault name="InsufficientFundException" use="literal"/>
</wsdl:fault>
<wsdl:fault name="AccountNotExistException">
<wsdlsoap:fault name="AccountNotExistException" use="literal"/>
</wsdl:fault>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="BankService">
<wsdl:port binding="tns:BankSoapBinding" name="Bank">
<wsdlsoap:address location="http://localhost:8080/bank/services/Bank"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Service code
The following code demonstrates how the custom fault messages are thrown:
package example;
public class BankServiceSkeleton {
public WithdrawResponse withdraw(Withdraw param1) throws InsufficientFundFaultMessage, AccountNotExistFaultMessage {
//
// Parameter handling
//
String account = param1.getAccount();
int amount = param1.getAmount();
//
// Error checks
//
if ("13".equals(account)) {
AccountNotExistFault fault = new AccountNotExistFault();
fault.setAccount(account);
AccountNotExistFaultMessage ex = new AccountNotExistFaultMessage("Account does not exist!");
ex.setFaultMessage(fault);
throw ex;
}
if (amount > 1000) {
InsufficientFundFault fault = new InsufficientFundFault();
fault.setAccount(account);
fault.setBalance(1000);
fault.setRequestedFund(amount);
InsufficientFundFaultMessage ex = new InsufficientFundFaultMessage("Insufficient funds");
ex.setFaultMessage(fault);
throw ex;
}
//
// Normal response
//
WithdrawResponse response = new WithdrawResponse();
response.setBalance(1000 - amount);
return response;
}
}
TESTING
The following SOAP message
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:exam="http://example">
<soapenv:Header/>
<soapenv:Body>
<exam:withdraw>
<exam:account>10</exam:account>
<exam:amount>2000</exam:amount>
</exam:withdraw>
</soapenv:Body>
</soapenv:Envelope>
Generates the following SOAP fault response
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<soapenv:Fault>
<faultcode>soapenv:Server</faultcode>
<faultstring>Insufficient funds</faultstring>
<detail>
<ns1:InsufficientFundFault xmlns:ns1="http://example">
<ns1:account>10</ns1:account>
<ns1:balance>1000</ns1:balance>
<ns1:requestedFund>2000</ns1:requestedFund>
</ns1:InsufficientFundFault>
</detail>
</soapenv:Fault>
</soapenv:Body>
</soapenv:Envelope>

Related

How to update the WSDL to process a response

Let's have a simple WSDL file:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="http://www.test.com"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap-env="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.test.com">
<wsdl:types>
<xs:schema targetNamespace="http://www.test.com">
<xs:element name="sessionId" type="xs:string">
</xs:element>
<xs:element name="transactionId" type="xs:string">
</xs:element>
<xs:element name="Login">
<xs:complexType>
<xs:sequence>
<xs:element name="userId" type="xs:string">
</xs:element>
<xs:element name="pwd" type="xs:string">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="LoginResponse">
<xs:complexType />
</xs:element>
</xs:schema>
</wsdl:types>
<wsdl:message name="Login">
<wsdl:part name="parameters" element="Login"/>
</wsdl:message>
<wsdl:message name="LoginResponse">
<wsdl:part name="parameters" element="LoginResponse"/>
</wsdl:message>
<wsdl:message name="HeaderSessionId">
<wsdl:part name="header" element="sessionId"/>
</wsdl:message>
<wsdl:message name="HeaderTransactionId">
<wsdl:part name="header" element="transactionId"/>
</wsdl:message>
<wsdl:portType name="MMCServicesPort">
<wsdl:operation name="Login">
<wsdl:input message="Login"/>
<wsdl:output message="LoginResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="MMCServicesBinding" type="MMCServicesPort">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="Login">
<wsdl:input>
<soap:body use="literal" />
</wsdl:input>
<wsdl:output>
<soap:header message="HeaderSessionId" part="header" use="literal"/>
<soap:body use="literal" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="MMCServicesService">
<wsdl:port name="MMCServicesService" binding="MMCServicesBinding">
<soap:address location="/test"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
For this WSDL the following message is a valid response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:test="http://www.test.com">
<soapenv:Header>
<test:sessionId>xxx</test:sessionId>
</soapenv:Header>
<soapenv:Body>
<test:LoginResponse/>
</soapenv:Body>
</soapenv:Envelope>
What/How do I need to change the WSDL to accept the following message as the Login operation response message instead:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Header>
<sessionId xmlns="http://www.test.com">xxx</sessionId>
</soapenv:Header>
<soapenv:Body>
<LoginResponse/>
</soapenv:Body>
</soapenv:Envelope>
...the LoginResponse is w/o a namespace definition.
I have a WS with unknown WSDL which doesn't provide the WSDL. The one above has been somehow reconstructed by someone else in the history. However the real WS which I need to use provides the 2nd response which is however refused by the Apache CXF java library.
Thank you.
The core issue seems to come with the definition of targetNamespace
in your code:
<xs:schema targetNamespace="http://www.test.com">
when replaced with:
<xs:schema targetNamespace="">
the SOAP XML should be without any prefix.
It might require also define the empty or default namespace at the wsdl:binding and wsdl:service level:
<wsdl:binding name="MMCServicesBinding" type="MMCServicesPort" xmlns="">
...
<wsdl:service name="MMCServicesService" xmlns="">
You might have built some code stubs based on that WSDL then you have to update also this generated code.

Mulesoft-CXF WSDL-First Web service error

All,
I have an issue with developing a contract-first SOAP web service in AnyPoint Studio (July 2014, with Muleserver 3.5.1 on max OS X, JDK 7). My process is:
Create WSDL by hand (XML Schema embedded inside WSDL for simplicity)
Create Synchronous HTTP flow in Anypoint
Generate Java classes from WSDL (no errors, works fine)
Start Flow from inside IDE (no errors,works fine).
Import WSDL and generate SOAP request in SOAPUI (no errors, works fine)
invoke SOAP request
AT this point I get the following error on marshalling the SOAP request (my flow has no backend logic and will fail - but that is not the issue):
org.apache.cxf.phase.PhaseInterceptorChain: Interceptor for {http://login.demo/}LoginServiceService has thrown exception, unwinding now
org.apache.cxf.interceptor.Fault: Message part {urn:MYNAMESPACE}requestParms was not recognized. (Does it exist in service WSDL?)
at org.apache.cxf.interceptor.DocLiteralInInterceptor.validatePart(DocLiteralInInterceptor.java:231)
at org.apache.cxf.interceptor.DocLiteralInInterceptor.handleMessage(DocLiteralInInterceptor.java:201)
at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:122)
at org.mule.module.cxf.CxfInboundMessageProcessor.sendToDestination(CxfInboundMessageProcessor.java:338)
My WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions targetNamespace="urn:MYNAMESPACE"
xmlns:tns="urn:MYNAMESPACE"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:soap12="http://schemas.xmlsoap.org/wsdl/soap12/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<wsdl:types>
<xs:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
targetNamespace="urn:MYNAMESPACE"
xmlns="urn:MYNAMESPACE"
elementFormDefault="unqualified" attributeFormDefault="unqualified">
<xs:element name="requestParms" type="LoginRequestType" />
<xs:element name="responseParms" type="LoginResponseType"/>
<xs:complexType name="LoginRequestType">
<xs:sequence>
<xs:element name="username" type="xs:string"/>
<xs:element name="password" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="LoginResponseType">
<xs:sequence>
<xs:element name="success" type="xs:boolean"/>
<xs:element name="authenticatedToken" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<!-- MESSAGES -->
<wsdl:message name="LoginRequest">
<wsdl:part name="parameters" element="tns:requestParms"/>
</wsdl:message>
<wsdl:message name="LoginResponse">
<wsdl:part name="parameters" element="tns:responseParms"/>
</wsdl:message>
<!-- WSDL Port Types -->
<wsdl:portType name="AuthenticatePortType">
<wsdl:operation name="login">
<wsdl:input message="tns:LoginRequest"/>
<wsdl:output message="tns:LoginResponse"/>
</wsdl:operation>
</wsdl:portType>
<!-- WSDL Bindings -->
<wsdl:binding name="AuthenticateBinding" type="tns:AuthenticatePortType">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="login">
<soap:operation soapAction="login"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<!-- WSDL Services -->
<wsdl:service name="LoginService">
<wsdl:port name="LoginPort" binding="tns:AuthenticateBinding">
<soap:address location="http://localhost:8081/demo"/>
</wsdl:port>
</wsdl:service>
My Mule Config XML:
<http:endpoint exchange-pattern="request-response" host="localhost" port="8081" method="POST" name="HTTP" doc:name="HTTP"/>
<flow name="loginFlow" doc:name="loginFlow" initialState="started">
<http:inbound-endpoint exchange-pattern="request-response" path="demo" doc:name="Demo" host="localhost" port="8081"/>
<cxf:jaxws-service doc:name="CXF" validationEnabled="true" serviceClass="demo.login.LoginService"/>
</flow>
My SOAP Request:
<soapenv:Envelope xmlns:ns="urn:MYNAMESPACE"
xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" >
<soapenv:Header/>
<soapenv:Body>
<ns:requestParms>
<username>aa</username>
<password>bb</password>
</ns:requestParms>
</soapenv:Body>
</soapenv:Envelope>
Also, I have not modified the generated java code (wsdl2java I assume inside Anypoint) - just run it.
Any suggestions?

nullable WSDL message part?

Problem:
I have a SOAP service with the following simplified WSDL:
<?xml version="1.0" encoding="UTF-8"?>
<wsdl:definitions xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:http="http://schemas.xmlsoap.org/wsdl/http/" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:mime="http://schemas.xmlsoap.org/wsdl/mime/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://new.webservice.namespace" targetNamespace="http://new.webservice.namespace">
<wsdl:types>
<xs:schema targetNamespace="http://new.webservice.namespace" elementFormDefault="qualified"/>
</wsdl:types>
<wsdl:message name="NewMessageRequest">
<wsdl:part name="parameter" type="xs:string"/>
</wsdl:message>
<wsdl:message name="NewMessageResponse">
<wsdl:part name="result" type="xs:string"/>
<wsdl:part name="param2" type="xs:string"/>
</wsdl:message>
<wsdl:portType name="NewPortType">
<wsdl:operation name="NewOperation">
<wsdl:input message="tns:NewMessageRequest"/>
<wsdl:output message="tns:NewMessageResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="NewBinding" type="tns:NewPortType">
<soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsdl:operation name="NewOperation">
<soap:operation soapAction="urn:#NewOperation"/>
<wsdl:input>
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output>
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="NewService">
<wsdl:port name="NewPort" binding="tns:NewBinding">
<soap:address location="No Target Adress"/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Notice the output message has two parts.
When invoking the SOAP services with SoapUI, the services implemented with the gSOAP framework returns a response which does not comply with the WSDL:
This is the SoapUI request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:new="http://new.webservice.namespace">
<soapenv:Header/>
<soapenv:Body>
<new:NewOperation>
<parameter>Hello</parameter>
</new:NewOperation>
</soapenv:Body>
</soapenv:Envelope>
This is the gSOAP WS response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:new="http://new.webservice.namespace">
<soapenv:Header/>
<soapenv:Body>
<new:NewOperationResponse>
<result xsi:nil="true"/>
<param2>Hello World</param2>
</new:NewOperationResponse>
</soapenv:Body>
</soapenv:Envelope>
SoapUI complains with the following error:
line5: Element has xsi:nil attribute but is not nillable
Question:
How can I fix the WSDL so the message part is nullable?
It appears you may have set the SOAP_XML_NIL flag? This flag should not be set. See the gsoap documentation stating for SOAP_XML_NIL: output NULLs as xsi:nil.

JBossWS doesn't recognize WS-A header

I have a web-service stub implemented with JAX-WS and deployed on JBossAS 7. Here is a source code:
package org.mycompany.adapters.ws;
import javax.jws.WebMethod;
import javax.jws.WebService;
import javax.xml.ws.soap.Addressing;
#WebService
#Addressing(enabled = true, required = true)
public class AdapterSessionManager {
#WebMethod
public String initAdapterSession() {
return "hello";
}
}
Here is a WSDL generated by JBoss for this web-service:
<wsdl:definitions name="AdapterSessionManagerService" targetNamespace="http://ws.adapters.mycompany.org/" xmlns:ns1="http://schemas.xmlsoap.org/soap/http" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:tns="http://ws.adapters.mycompany.org/" xmlns:wsam="http://www.w3.org/2007/05/addressing/metadata" xmlns:wsaw="http://www.w3.org/2006/05/addressing/wsdl" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns:wsp="http://www.w3.org/ns/ws-policy" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:types>
<xs:schema elementFormDefault="unqualified" targetNamespace="http://ws.adapters.mycompany.org/" version="1.0" xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="initAdapterSession" type="tns:initAdapterSession"/>
<xs:element name="initAdapterSessionResponse" type="tns:initAdapterSessionResponse"/>
<xs:complexType name="initAdapterSession">
<xs:sequence/>
</xs:complexType>
<xs:complexType name="initAdapterSessionResponse">
<xs:sequence>
<xs:element minOccurs="0" name="return" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>
</wsdl:types>
<wsdl:message name="initAdapterSessionResponse">
<wsdl:part element="tns:initAdapterSessionResponse" name="parameters"/>
</wsdl:message>
<wsdl:message name="initAdapterSession">
<wsdl:part element="tns:initAdapterSession" name="parameters"/>
</wsdl:message>
<wsdl:portType name="AdapterSessionManager">
<wsdl:operation name="initAdapterSession">
<wsdl:input message="tns:initAdapterSession" name="initAdapterSession" wsam:Action="http://ws.adapters.mycompany.org/AdapterSessionManager/initAdapterSessionRequest" wsaw:Action="http://ws.adapters.mycompany.org/AdapterSessionManager/initAdapterSessionRequest"/>
<wsdl:output message="tns:initAdapterSessionResponse" name="initAdapterSessionResponse" wsam:Action="http://ws.adapters.mycompany.org/AdapterSessionManager/initAdapterSessionResponse" wsaw:Action="http://ws.adapters.mycompany.org/AdapterSessionManager/initAdapterSessionResponse"/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="AdapterSessionManagerServiceSoapBinding" type="tns:AdapterSessionManager">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<wsaw:UsingAddressing wsdl:required="true"/>
<wsp:PolicyReference URI="#AdapterSessionManagerServiceSoapBinding_WSAM_Addressing_Policy"/>
<wsdl:operation name="initAdapterSession">
<soap:operation soapAction="" style="document"/>
<wsdl:input name="initAdapterSession">
<soap:body use="literal"/>
</wsdl:input>
<wsdl:output name="initAdapterSessionResponse">
<soap:body use="literal"/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="AdapterSessionManagerService">
<wsdl:port binding="tns:AdapterSessionManagerServiceSoapBinding" name="AdapterSessionManagerPort">
<soap:address location="http://localhost:8081/adapters/AdapterSessionManager"/>
</wsdl:port>
</wsdl:service>
<wsp:Policy wsu:Id="AdapterSessionManagerServiceSoapBinding_WSAM_Addressing_Policy" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<wsam:Addressing>
<wsp:Policy/>
</wsam:Addressing>
</wsp:Policy>
</wsdl:definitions>
When I try to invoke initAdapterSession with the following SOAP-request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ws="http://ws.adapters.mycompany.org/">
<soapenv:Header xmlns:wsa="http://www.w3.org/2005/08/addressing">
<wsa:Action>http://ws.adapters.mycompany.org/AdapterSessionManager/initAdapterSessionRequest</wsa:Action>
</soapenv:Header>
<soapenv:Body>
<ws:initAdapterSession/>
</soapenv:Body>
</soapenv:Envelope>
"A required header representing a Message Addressing Property is not present" SOAP fault occurs:
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Header>
<Action xmlns="http://www.w3.org/2005/08/addressing">http://ws.adapters.mycompany.org/AdapterSessionManager/initAdapterSession/Fault/SoapFault</Action>
<MessageID xmlns="http://www.w3.org/2005/08/addressing">urn:uuid:d5b5c6aa-fd66-49bd-b928-488fa8e07f7b</MessageID>
<RelatesTo xmlns="http://www.w3.org/2005/08/addressing">http://www.w3.org/2005/08/addressing/unspecified</RelatesTo>
</soap:Header>
<soap:Body>
<soap:Fault>
<faultcode xmlns:ns1="http://www.w3.org/2005/08/addressing">ns1:MessageAddressingHeaderRequired</faultcode>
<faultstring>A required header representing a Message Addressing Property is not present</faultstring>
</soap:Fault>
</soap:Body>
</soap:Envelope>
The SOAP-request is sent by soapUI. All WS-A options in soapUI preferences (WS-A settings tab) are disabled. Enable WS-A addressing checkbox in request settings is switched off too. Actually the same error occurs even when all these options are enabled.
Why JBoss doesn't see WS-A header within the request?
The SOAP fault "A required header representing a Message Addressing Property is not present" happens when a SOAP message does not have all the required WS-Addressing header information. It's not a JBoss specific exception, I've had this happen to me on WebSphere as well.
Your request only shows that it's sending the Action header. Looking at the spec (http://www.w3.org/Submission/ws-addressing/#_Toc77464323) it seems you need to send both the Action and To headers. The other option is to not send any WS-Addressing headers at all, but I would guess that, based on your WSDL, the server may not accept messages without WS-Addressing.
Just found lacking header. The fault doesn't arise if wsa:MessageID is passed with a SOAP-request. In my opinion it's a weird behavior, given that the wsa:MessageID is described as an optional header in WS-A 1.0 specification.

Cisco UCP Web Service Issue AuthenticateUser

Update: This issue has been resolved. I was trying to authenticate various admin accounts which apparently are in a separate database than the user accounts this service talks to. I used a generic user account that I created in CISCO and the web service calls worked great!
I would like to thank #Yahia for the recommendation on running Fiddler also!
I've been reading over the CICCO UCP Web Service documentation for days now. I'm able to talk to the one web service on the box, with proper credentials and everything works fine; however, with the UCP Service, I get an error... SoapUI seems to understand the WSDL file, and I'm able to send a request to the endpoint but I get an authentication error, below.
I use the same username and password to login to the ACS Portal so the account is not expired. I'm pretty much lost on this one and at the mercy of CICSO tech support. Any and all ideas are welcome!
SOAP Response:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<ns1:authenticateUserResponse soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns1="http://cisco.com/nm/acs/mgmt/ucp/service/">
<authenticateUserReturn href="#id0"/>
</ns1:authenticateUserResponse>
<multiRef id="id0" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns2:ResponseType" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:ns2="http://cisco.com/nm/acs/mgmt/ucp/service/">
<errors soapenc:arrayType="xsd:string[1]" xsi:type="soapenc:Array">
<errors xsi:type="xsd:string">Credentials are incorrect.</errors>
</errors>
<status href="#id1"/>
</multiRef>
<multiRef id="id1" soapenc:root="0" soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xsi:type="ns3:StatusCodeType" xmlns:ns3="http://cisco.com/nm/acs/mgmt/ucp/service/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/">failure</multiRef>
</soapenv:Body>
</soapenv:Envelope>
Soap Envelope:
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://cisco.com/nm/acs/mgmt/ucp/service/">
<soapenv:Header/>
<soapenv:Body>
<ser:authenticateUser soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<userName xsi:type="xsd:string">myusername</userName>
<password xsi:type="xsd:string">mypassword</password>
</ser:authenticateUser>
</soapenv:Body>
</soapenv:Envelope>
And the WSDL:
<?xml version="1.0" encoding="utf-8"?>
<wsdl:definitions targetNamespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
xmlns:apachesoap="http://xml.apache.org/xml-soap"
xmlns:impl="http://www.cisco.com/wsdl.service"
xmlns:intf="http://cisco.com/nm/acs/mgmt/ucp/service/"
xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:wsdlsoap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<wsdl:documentation>Copyright (c) 2007, 2009 Cisco Systems, Inc.
WSDL Service Interface for ACS5.1 User Change Password interface
(UCP) This WSDL document defines the publication API calls for
interacting with the ACS UCP service.</wsdl:documentation>
<wsdl:types>
<schema targetNamespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
xmlns="http://www.w3.org/2001/XMLSchema">
<import namespace="http://schemas.xmlsoap.org/soap/encoding/" />
<complexType name="ArrayOf_xsd_string">
<complexContent>
<restriction base="soapenc:Array">
<attribute ref="soapenc:arrayType"
wsdl:arrayType="xsd:string[]" />
</restriction>
</complexContent>
</complexType>
<simpleType name="StatusCodeType">
<restriction base="string">
<enumeration value="success" />
<enumeration value="failure" />
</restriction>
</simpleType>
<complexType name="ResponseType">
<sequence>
<element name="errors" nillable="true"
type="intf:ArrayOf_xsd_string" />
<element name="status" nillable="false"
type="intf:StatusCodeType" />
</sequence>
</complexType>
</schema>
</wsdl:types>
<wsdl:message name="changeUserPassRequest">
<wsdl:part name="userName" type="xsd:string" />
<wsdl:part name="oldPassword" type="xsd:string" />
<wsdl:part name="newPassword" type="xsd:string" />
</wsdl:message>
<wsdl:message name="authenticateUserRequest">
<wsdl:part name="userName" type="xsd:string" />
<wsdl:part name="password" type="xsd:string" />
</wsdl:message>
<wsdl:message name="changeUserPassResponse">
<wsdl:part name="changeUserPassReturn"
type="intf:ResponseType" />
</wsdl:message>
<wsdl:message name="authenticateUserResponse">
<wsdl:part name="authenticateUserReturn"
type="intf:ResponseType" />
</wsdl:message>
<wsdl:portType name="UCP">
<wsdl:operation name="authenticateUser"
parameterOrder="userName password">
<wsdl:input message="intf:authenticateUserRequest"
name="authenticateUserRequest" />
<wsdl:output message="intf:authenticateUserResponse"
name="authenticateUserResponse" />
</wsdl:operation>
<wsdl:operation name="changeUserPass"
parameterOrder="userName oldPassword newPassword">
<wsdl:input message="intf:changeUserPassRequest"
name="changeUserPassRequest" />
<wsdl:output message="intf:changeUserPassResponse"
name="changeUserPassResponse" />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name="UCP" type="intf:UCP">
<wsdlsoap:binding style="rpc"
transport="http://schemas.xmlsoap.org/soap/http" />
<wsdl:operation name="authenticateUser">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="authenticateUserRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:input>
<wsdl:output name="authenticateUserResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:output>
</wsdl:operation>
<wsdl:operation name="changeUserPass">
<wsdlsoap:operation soapAction="" />
<wsdl:input name="changeUserPassRequest">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:input>
<wsdl:output name="changeUserPassResponse">
<wsdlsoap:body encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"
namespace="http://cisco.com/nm/acs/mgmt/ucp/service/"
use="encoded" />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name="UCPService">
<wsdl:port binding="intf:UCP" name="UCP">
<wsdlsoap:address location="https://localhost/PI/services/UCP/" />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Update: This issue has been resolved. I was trying to authenticate various admin accounts which apparently are in a separate database than the user accounts this service talks to. I used a generic user account that I created in CISCO and the web service calls worked great!
I would like to thank #Yahia for the recommendation on running Fiddler also!