|
View:
New views
1 Messages
—
Rating Filter:
Alert me
|
|
|
Issue with Dynamic invocation of Webservices JAX RPCHi,
Am using JAX RPC for webserices client implementation. Here is my WSDL content which is deployed on SAP system:
xml
version="1.0" encoding="utf-8" ?>
- <wsdl:definitions
targetNamespace="urn:sap-com:document:sap:rfc:functions"
xmlns:http="http://schemas.xmlsoap.org/wsdl/http/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:tns="urn:sap-com:document:sap:rfc:functions"
xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
- <xsd:schema
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:tns="urn:sap-com:document:sap:rfc:functions"
targetNamespace="urn:sap-com:document:sap:rfc:functions"
elementFormDefault="unqualified"
attributeFormDefault="qualified">
<xsd:maxLength
value="100"
/>
xsd:restriction>
xsd:simpleType>
<xsd:maxLength
value="20"
/>
xsd:restriction>
xsd:simpleType>
<xsd:maxLength
value="250"
/>
xsd:restriction>
xsd:simpleType>
<xsd:maxLength
value="50"
/>
xsd:restriction>
xsd:simpleType>
<xsd:maxLength
value="3"
/>
<xsd:pattern
value="\d*"
/>
xsd:restriction>
xsd:simpleType>
<xsd:element
name="PRODUCT_ID"
type="tns:char50"
/>
<xsd:element
name="PRODUCT_NUMBER"
type="tns:char20"
/>
<xsd:element
name="ALTERNATE_NAME"
type="tns:char100"
/>
<xsd:element
name="DESCRIPTION"
type="tns:char250"
/>
xsd:sequence>
xsd:complexType>
<xsd:element
name="item"
minOccurs="0"
maxOccurs="unbounded"
type="tns:ZWS_RECORD_SIMPLE"
/>
xsd:sequence>
xsd:complexType>
xsd:schema>
wsdl:types>
<wsdl:part
name="parameters"
element="tns:ZMDM_WEBSERVICE"
/>
wsdl:message>
<wsdl:part
name="parameters"
element="tns:ZMDM_WEBSERVICEResponse"
/>
wsdl:message>
<wsdl:input
message="tns:ZMDM_WEBSERVICE"
/>
<wsdl:output
message="tns:ZMDM_WEBSERVICEResponse"
/>
wsdl:operation>
wsdl:portType>
wsdl:binding>
<soap:address
location="http://sapbisbx.test.com:8000/sap/bc/srt/rfc/sap/ZMDM_WEBSERVICE?sap-client=001"
/>
wsdl:port>
wsdl:service>
wsdl:definitions>
Here is the content of config-wsdl.xml content: <configuration xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config"> <wsdl location="http://sapbisbx.cadence.com:8000/sap/bc/srt/rfc/sap/ZMDM_WEBSERVICE?wsdl=1.1" packageName="Test" /> </configuration> This is my client dynamic invocation program: package Test; import java.net.URL; import javax.xml.rpc.Service; import javax.xml.rpc.JAXRPCException; import javax.xml.namespace.QName; import javax.xml.rpc.ServiceFactory; //import dynamicproxy.ZMDM_WEBSERVICE; import javax.xml.rpc.soap.SOAPFaultException; import Test.*; public class SapClient { private String endpointAddress; public static void main(String argv[]) { try { // Invoke createProxy() to create a stub object //Stub stub = createProxy(); String nameSpaceUri = "urn:sap-com:document:sap:rfc:functions"; String serviceName = "ZMDM_WEBSERVICEService"; String portName = "ZMDM_WEBSERVICESoapBinding"; //String portName ="ZTEST_MY_NEW"; // Set the endpoint address the stub uses to access the service URL url = new URL( "http://sapbisbx.test.com:8000/sap/bc/srt/rfc/sap/ZMDM_WEBSERVICE?wsdl=1.1"); // Create an instance of service factory ServiceFactory serviceFactory = ServiceFactory.newInstance(); // Create a service object to act as a factory for proxies. Service mathService = serviceFactory.createService(url, new QName(nameSpaceUri, serviceName)); // Create a proxy ZWS_RECORD_SIMPLE myProxy = (ZWS_RECORD_SIMPLE) mathService.getPort(new QName(nameSpaceUri, portName), ZWS_RECORD_SIMPLE.class); // Cast the stub to the service endpoint interface (MathFace) ZtestMy2[ ] rec = myProxy.ztestMyNew("SYNCED").getItem(); if(rec!=null) { System.out.println(" PRODUCT_ID EosuuportDate ProductNumber ApproveStatus") ; for (int i=0;i<rec.length ; i++ ) { System.out.println(rec[i].getProductId()+" "+rec[i].getEosupportDate()+" " +rec[i].getProductNumber() +" "+ rec[i].getApproveStatus()) ; } } else System.out.println("Return Value ---no records"); */ //System.out.println("Return Value --- "+math.ZTEST_MY("SYNCED").getItem()); }catch (SOAPFaultException e) { System.out.println("In Soap Exception Block"); System.out.println(" Soap Exception " +e.getDetail()); e.getDetail(); } /*catch (ClassNotFoundException e) { e.printStackTrace(); } */ /*catch (ServiceException e) { e.printStackTrace(); }*/ catch (Exception ex) { ex.printStackTrace(); } } } Problem : If i run using Java command at the console, its throws me exception : D:\Webservice\Dynamic-proxy3\build>java Test.SapClient port: {urn:sap-com:document:sap:rfc:functions}ZMDM_WEBSERVICESoapBinding does no t contain operation: getPRODUCT_ID at com.sun.xml.rpc.client.dii.ConfiguredCall.configureCall(ConfiguredCal l.java:98) at com.sun.xml.rpc.client.dii.ConfiguredCall.configureCall(ConfiguredCal l.java:69) at com.sun.xml.rpc.client.dii.ConfiguredCall.setMethodName(ConfiguredCal l.java:50) at com.sun.xml.rpc.client.dii.DynamicProxyBuilder.buildDynamicProxyFor(D ynamicProxyBuilder.java:66) at com.sun.xml.rpc.client.dii.ConfiguredService.getPort(ConfiguredServic e.java:250) at Test.SapClient.main(SapClient.java:39) Request you to help me to over come this issue... Thanks a bunch in advance... -- Regards, -Vj |
| Free embeddable forum powered by Nabble | Forum Help |