cancel
Showing results for 
Search instead for 
Did you mean: 

WebService-Java-Problem

Former Member
0 Kudos

Hello Experts,

I´am trying to connect my Java-Program with a webservice in SAP-System. I generated the Service by myself with a Functionblock, a simple one, just import four parameters form java into sap. The service works very fine. I tested it with SOAPUI (WSDL-URL: http://localhost:8000/sap/bc/srt/wsdl/bndg_DE1A24DE2892DFF1940C0013779CE381/wsdl11/allinone/ws_polic....

After this I wanted to generate the classes for Java with wsimport. Here was the problem that wsimport couldn´t read all tags of the WSDL, for example UsingPolicy, and I have to edit the file by myself. At least it works and I got my classes. Now I want to import the four parameters but if I run the Application I´ve got this errormessage:

Exception in thread "main" javax.xml.ws.WebServiceException: Failed to access the WSDL at: http://localhost:8000/sap/bc/srt/wsdl/bndg_DE1A24DE2892DFF1940C0013779CE381/wsdl11/allinone/ws_polic.... It failed with:

Server returned HTTP response code: 401 for URL: http://localhost:8000/sap/bc/srt/wsdl/bndg_DE1A24DE2892DFF1940C0013779CE381/wsdl11/allinone/ws_polic....

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.tryWithMex(RuntimeWSDLParser.java:136)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:122)

at com.sun.xml.internal.ws.client.WSServiceDelegate.parseWSDL(WSServiceDelegate.java:226)

at com.sun.xml.internal.ws.client.WSServiceDelegate.(Service.java:40)

at com.nh.sap_erp.DatenübertragungWebService.main(DatenübertragungWebService.java:13)

Caused by: java.io.IOException: Server returned HTTP response code: 401 for URL: http://localhost:8000/sap/bc/srt/wsdl/bndg_DE1A24DE2892DFF1940C0013779CE381/wsdl11/allinone/ws_polic...

at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1241)

at java.net.URL.openStream(URL.java:1009)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.createReader(RuntimeWSDLParser.java:785)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.resolveWSDL(RuntimeWSDLParser.java:236)

at com.sun.xml.internal.ws.wsdl.parser.RuntimeWSDLParser.parse(RuntimeWSDLParser.java:107)

... 7 more

I´ve checked so many tutorials but I couldn´t find a solution. So I hope, anyone of you can help me!

Thanks a lot!

Nicole

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

Have you tried to generate the proxy using Developer Studio with SAP Libraries?

Best regards

Former Member
0 Kudos

Hi,

no, I started with my own Java and eclipse. There are other programm parts in. Do I need this tool? SAP NetWeaver Developer studio?

I´ll try this.

Thank you

Nicole

Former Member
0 Kudos

Hi,

Is possible to generate using other tool, but if you can test Developer Studio, will be more easy to identify the problem. I've created proxies to Web Services like you using Developer Studio and without developer studio. Depending on tool is need to make some adjusts on WSDL.

Best regards