on 12-20-2011 9:43 PM
I am having trouble consuming an ABAP Web Service from JAVA using the SAP ME (Manufacturing Execution) SDK. I created a very simple un-authenticated web service that takes a string an input and returns the same string in reverse order. I have setup the service and created the endpoints in SOAMANAGER. I can call the web service from SOAPUI and .Net. When I attempt to use the MESDK (in eclipse) to generate the JAVA class, I need to change the namespace in the WSDL generated by sap from urn:sap-com:document:sap:soap:functions:mc-style to something the MESDK requires. The targetNamespace for MESDK is required to be of the format http://<vendor>.com/ServiceName. In my case, http://y12me.com/zspub_ReverseHTTP. When I attempt to use the web service via the generated Java proxy (I believe ME is using the standard JAX and eclispe tools but my Java is weak), I get the following error:
Virtual Interface Method >ZsReverse::http://y12me.com/zspub_ReverseHTTP< not supported
This makes sense, because the method namespace in SAP is urn:sap-com:document:sap:soap:functions:mc-style.
So, what I assume I need to do is to override the either the targetNamespace in JAVA or change the SOAP namespace in SAP. I started with SAP as that is where I am most familiar. I cannot find anywhere that I can modify the SOAP Namespace. It is not an input field on the wizard when I generated the proxy class and it is not an editable field on the service definition. I found a reference in the old NW04 help files that shows how to define a virtual interface in the wizard at runtime but those options are not available on my ECC 6.0 (ep4) system.
In looking at the JAVA, the code is very simple but I cannot see any methods or attributes that will alter this. The code is very simple:
ZsPubReversePlain ws = new ZsPubReversePlain();
ZSPUBREVERSEWS myPort = ws.getZsPubReversePlainBinding();
Map<String, Object> ctx = ((BindingProvider) myPort).getRequestContext();
ctx.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, ".../zspubreverseplain/zspubreverseplainbinding");
String out = myPort.zsReverse("Testing");
The code above gives the previously mentioned error. I also get the same error in SOAPUI if I change the namespace in the XML to the http://y12me.com/.
The only other options on the BindingProvider are URI_PROPERTY and USE_PORPERTY. I tried the following to see if that would override but got the same error.
ctx.put(BindingProvider.SOAPACTION_URI_PROPERTY, "ZsReverse::sap-com:document:sap:soap:functions:mc-style");
ctx.put(BindingProvider.SOAPACTION_USE_PROPERTY, Boolean.TRUE.toString());
Any help from either end, changing the SOAP Namespace in ECC or overriding the WSDL namespace at runtime from Java would be greatly appreciated.
Thanks in advance - Michael
My error. I needed to generate the WSDL with different parameters from the R/3 side to get one that is JAX-WS compliant.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.