- This topic has 7 replies, 2 voices, and was last updated 14 years, 5 months ago by Mohamad Sariman.
-
AuthorPosts
-
Mohamad SarimanParticipantAnyone please help,
I am consuming a web service created by another party and I used the wizard in my eclipse blue ide. The code generation looks good with one error during generation of the code but I ignored it.When I tried to consume the web service with the sample code below i got an error when I tried to submit.
try
{
GetPolicyInformationRequest req = new GetPolicyInformationRequest();
req.setPolicyNumber(“3355727″);
ECMService service = new ECMService();
ECMPortType portType = service.getECMPort();
GetPolicyInformationResponse resp = portType.getPolicyInformation(req);
} catch (Exception ex)
{
ex.printStackTrace();
}******************************
Retrieving document at ‘http://wpg1dson001:2580/’.
Jul 8, 2010 1:12:23 PM null null
AUDIT: chain.started
javax.xml.ws.WebServiceException: org.apache.axis2.AxisFault: A required message information header, To, MessageID, or Action, is not present.
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:572)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:123)
at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:338)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:159)
at $Proxy25.getPolicyInformation(Unknown Source)
at com.rko.filenet.app.BaseClass.main(BaseClass.java:81)
8888****************** WSDL File ******************************
<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no”?>
<wsdl:definitions xmlns:ecm=”http://www.rkonesa.com/ECM” xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” targetNamespace=”http://www.rkonesa.com/ECM”>
<wsdl:types>
<xsd:schema>
<xsd:element name=”GetPolicyInformationRequest”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”PolicyNumber” type=”xsd:string”>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=”GetPolicyInformationResponse”>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs=”0″ name=”PolicyNumber” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”PolicySymbol” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”ModuleNumber” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”Branch” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”TermEffectiveDate” nillable=”true” type=”xsd:date”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”TermExpirationDate” nillable=”true” type=”xsd:date”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”InsuredName” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”InsuredName2″ nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”MethodOfPayment” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”ModeOfPayment” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”MonthlyAutowithdrawAccount” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”AgencyNumber” nillable=”true” type=”xsd:string”>
</xsd:element>
<xsd:element minOccurs=”0″ name=”EmployeeAccount” nillable=”true” type=”xsd:boolean”>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name=”GetPolicyInformationResponse”>
<wsdl:part element=”GetPolicyInformationResponse” name=”GetPolicyInformationResponse”/>
</wsdl:message>
<wsdl:message name=”GetPolicyInformationRequest”>
<wsdl:part element=”GetPolicyInformationRequest” name=”GetPolicyInformationRequest”/>
</wsdl:message>
<wsdl:portType name=”ECMPortType”>
<wsdl:operation name=”GetPolicyInformation”>
<wsdl:input message=”ecm:GetPolicyInformationRequest”/>
<wsdl:output message=”ecm:GetPolicyInformationResponse”/>
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name=”ECMSOAPBinding” type=”ecm:ECMPortType”>
<soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http”/>
<wsdl:operation name=”GetPolicyInformation”>
<soap:operation soapAction=”http://www.rkonesa.com/ECM/GetPolicyInformation”/>
<wsdl:input>
<soap:body use=”literal”/>
</wsdl:input>
<wsdl:output>
<soap:body use=”literal”/>
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name=”ECMService”>
<wsdl:port binding=”ecm:ECMSOAPBinding” name=”ECMPort”>
<soap:address location=”http://wpg1dson001:2580/EcmService”/>
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Brian FernandesModeratormsariman,
I believe you are invoking an AXIS wizard to generate the web service client and not the JAX-WS wizards that MyEclipse supports. Our wizards are at
File > New > Other > MyEclipse > Web Services > Web Service Client or you can invoke the wizard from the drop down on the toolbar.Nevertheless, the WSDL you have supplied is not perfectly valid, which is why generated clients will still have errors. If you open the WSDL file in our editor and validate it, you will see the following warning. This must be corrected before going on.
WS-I: (BP2107) A xsd:schema element contained in a wsdl:types element does not have a targetNamespace attribute with a valid and non-null value, while having child element(s) other than xsd:import or xsd:annotation
Hope this helps.
Mohamad SarimanParticipantHi,
I told the provider to fix their web service and when I use the wizard again, I don’t get any errors.
But when I tried to consume them I still get the errors.org.apache.axis2.AxisFault: A required message information header, To, MessageID, or Action, is not present.
at org.apache.axis2.jaxws.ExceptionFactory.createWebServiceException(ExceptionFactory.java:175)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:70)
at org.apache.axis2.jaxws.ExceptionFactory.makeWebServiceException(ExceptionFactory.java:128)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:572)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.doInvoke(AxisInvocationController.java:123)
at org.apache.axis2.jaxws.core.controller.impl.InvocationControllerImpl.invoke(InvocationControllerImpl.java:93)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invokeSEIMethod(JAXWSProxyHandler.java:338)
at org.apache.axis2.jaxws.client.proxy.JAXWSProxyHandler.invoke(JAXWSProxyHandler.java:159)
at $Proxy25.getPolicyInformation(Unknown Source)
at com.rko.filenet.app.BaseClass.main(BaseClass.java:82)
Caused by: org.apache.axis2.AxisFault: A required message information header, To, MessageID, or Action, is not present.
at org.apache.axis2.addressing.AddressingFaultsHelper.triggerAddressingFault(AddressingFaultsHelper.java:373)
at org.apache.axis2.addressing.AddressingFaultsHelper.triggerMessageAddressingRequiredFault(AddressingFaultsHelper.java:293)
at org.apache.axis2.handlers.addressing.AddressingInHandler.checkForMandatoryHeaders(AddressingInHandler.java:299)
at org.apache.axis2.handlers.addressing.AddressingInHandler.extractAddressingInformation(AddressingInHandler.java:274)
at org.apache.axis2.handlers.addressing.AddressingInHandler.invoke(AddressingInHandler.java:153)
at org.apache.axis2.engine.Phase.invoke(Phase.java:318)
at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:268)
at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:175)
at org.apache.axis2.description.OutInAxisOperationClient.handleResponse(OutInAxisOperation.java:363)
at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:416)
at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:228)
at org.apache.axis2.client.OperationClient.execute(OperationClient.java:163)
at org.apache.axis2.jaxws.core.controller.impl.AxisInvocationController.execute(AxisInvocationController.java:567)
… 6 more
Mohamad SarimanParticipant<?xml version=”1.0″ encoding=”UTF-8″ standalone=”no” ?>
<wsdl:definitions xmlns:ecm=”http://www.rkonesa.com/ECM” xmlns:soap=”http://schemas.xmlsoap.org/wsdl/soap/” xmlns:wsdl=”http://schemas.xmlsoap.org/wsdl/” xmlns:xsd=”http://www.w3.org/2001/XMLSchema” targetNamespace=”http://www.rkonesa.com/ECM”>
<wsdl:types>
<xsd:schema xmlns=”http://www.rkonesa.com/ECM” targetNamespace=”http://www.rkonesa.com/ECM”>
<xsd:element name=”GetPolicyInformationRequest”>
<xsd:complexType>
<xsd:sequence>
<xsd:element name=”PolicyNumber” type=”xsd:string” />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element name=”GetPolicyInformationResponse”>
<xsd:complexType>
<xsd:sequence>
<xsd:element minOccurs=”0″ name=”PolicyNumber” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”PolicySymbol” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”ModuleNumber” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”Branch” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”TermEffectiveDate” nillable=”true” type=”xsd:date” />
<xsd:element minOccurs=”0″ name=”TermExpirationDate” nillable=”true” type=”xsd:date” />
<xsd:element minOccurs=”0″ name=”InsuredName” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”InsuredName2″ nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”MethodOfPayment” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”ModeOfPayment” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”MonthlyAutowithdrawAccount” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”AgencyNumber” nillable=”true” type=”xsd:string” />
<xsd:element minOccurs=”0″ name=”EmployeeAccount” nillable=”true” type=”xsd:boolean” />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
</wsdl:types>
<wsdl:message name=”GetPolicyInformationResponse”>
<wsdl:part element=”ecm:GetPolicyInformationResponse” name=”GetPolicyInformationResponse” />
</wsdl:message>
<wsdl:message name=”GetPolicyInformationRequest”>
<wsdl:part element=”ecm:GetPolicyInformationRequest” name=”GetPolicyInformationRequest” />
</wsdl:message>
<wsdl:portType name=”ECMPortType”>
<wsdl:operation name=”GetPolicyInformation”>
<wsdl:input message=”ecm:GetPolicyInformationRequest” />
<wsdl:output message=”ecm:GetPolicyInformationResponse” />
</wsdl:operation>
</wsdl:portType>
<wsdl:binding name=”ECMSOAPBinding” type=”ecm:ECMPortType”>
<soap:binding style=”document” transport=”http://schemas.xmlsoap.org/soap/http” />
<wsdl:operation name=”GetPolicyInformation”>
<soap:operation soapAction=”http://www.rkonesa.com/ECM/GetPolicyInformation” />
<wsdl:input>
<soap:body use=”literal” />
</wsdl:input>
<wsdl:output>
<soap:body use=”literal” />
</wsdl:output>
</wsdl:operation>
</wsdl:binding>
<wsdl:service name=”ECMService”>
<wsdl:port binding=”ecm:ECMSOAPBinding” name=”ECMPort”>
<soap:address location=”http://wpg1dson001:2580/EcmService” />
</wsdl:port>
</wsdl:service>
</wsdl:definitions>
Mohamad SarimanParticipantWhen I use the web service explorer to consume, I don’t get an issue.
Could it be the wizard has a bug?
Brian FernandesModeratormsariman,
I was able to use your new WSDL without issue. As I clarified earlier, you seem to be using the wrong web service wizard.
believe you are invoking an AXIS wizard to generate the web service client and not the JAX-WS wizards that MyEclipse supports. Our wizards are at File > New > Other > MyEclipse > Web Services > Web Service Client or you can invoke the wizard from the drop down on the toolbar.
Are you sure you are using this wizard?
Mohamad SarimanParticipantBrian,
I’m using MyEclipse Blue and when I pulled the drop down I was given 4 selection.
1. JAX-WS
2. JAX-WS (WebSphere)
3. JAX-RPC (WebSphere)
4. XFireSo which one do I select?
Mohamad SarimanParticipantSorry Brian,
I was all the while using (1) JAX-WS. -
AuthorPosts