Web Service Proxy Generation from tModel
Hello,
I have created a Business (Web) Service in the UDDI supplied with the NW04s Java Stack SP06, under a new Business Entity. I have also created multiple tModels each corresponding to unique Web Service Descriptions (WSDs) of the same Web Service. I have linked two of the tModels to the Business Service created above.
Now using the NW Dev Studio I generate a Deployable Proxy for a single tModel of the Business Service. However this does not create a Logical Port definition and so I am unable to call the service with it. I go in to create a New Logical Port in the Proxy and the only viable option in the wizard is to supply the WSDL of the Business Service. But, when I do this it completely regenerates the proxy. Is there any way to prevent this? What is the benefit of having unique tModels if you can consume only the WSD you want to through a particular proxy?
I hope someone has tried this before me and can supply some useful answers. SAP Help Documentation pretty much draws a blank so I am not sure where to look.
Thanks,
Murtaza.
Hi Murtaza,
Was your issue resolved?
Kindly update.
Thanks and Regards,
Antony.
Similar Messages
-
Web service proxy generation validation failed - two declarations collision
Hi,
I'm creating a JAX-WS web service proxy against a web service with very complex payload. When I point the wizard to the WSDL, during the analysis, it throws an error,
Error creating model from wsdl "<mywsdl>": (Related to above error) This is the other declaration. Two declarations cause a collision in the ObjectFactory class.
Any pointers? How can I troubleshoot such error?found the fix discussed on this blog... http://kingsfleet.blogspot.com/2008/07/working-round-xsdchoice-binding-issue.html
-
Consuming Web Service - Proxy Generation Terminated
Hello all,
I have recently been exploring the capabilities of consuming Web Services from ABAP and have run into some issues.
When I generate the Client Proxy from different WSDL files, I am frequently getting these two errors:
<i>Proxy generation terminated: "mixed content" not supported</i>
<i>Proxy generation terminated: WSDL error (<extension> not supported)</i>
Is this just a limitation of ABAP? If I get these errors, is there any way to use the Web Service?
Thanks in advance!Hi, had the same issue. try to rename the file to .xml ending.
HTH; rgds, marco -
Web service proxy client from Oracle DB
I need to call an external webservice from oracle db... but this web service does not support "SOAP with attachments" and its specification says that we have to develop a J2EE proxy client to access this web service, this still could be done in a stored procedure, loading jdeveloper generated code in java?, I know that with Jdeveloper I can generate a 'web service stub/skeleton' but how make this stub accesible from oracle with PL/SQL? is this possible?
thanks in advanceI need to call an external webservice from oracle db... but this web service does not support "SOAP with attachments" and its specification says that we have to develop a J2EE proxy client to access this web service, this still could be done in a stored procedure, loading jdeveloper generated code in java?, I know that with Jdeveloper I can generate a 'web service stub/skeleton' but how make this stub accesible from oracle with PL/SQL? is this possible?
thanks in advance -
Web Service Proxy Generation failed
Hi @all,
i would like to consume a web service with the adaptive webdynpro model, but the proxy generation fails. Attached you will find the log file of the NWDS:
com.sap.tc.webdynpro.model.webservice.exception.WSModelRuntimeException: Exception on creation of service metadata for WSDL URL 'http://ktkrs3580/Elan2Webservice/elan_service.asmx?WSDL' and service factory configuration '{DynamicProxy.ClassPath=D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.tc.cmi_1.0.0/_cmi_api.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.exception_2.0.0/lib/exception.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/boot.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/iq-lib.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/util.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/webservices_lib.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/webservices.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/webservices_api.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.engine.webservices_2.0.0/lib/tc_sec_wssec_lib.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.dictionary.runtime_2.0.0/lib/SapDictionaryTypesRuntime.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.dictionary.services_2.0.0/lib/SapDictionaryTypeServices.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.tssap.sap.libs.logging_2.0.0/lib/logging.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.tssap.sap.libs.logging_2.0.0/lib/loggingStandard.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.tssap.sap.libs.logging_2.0.0/lib/jARM.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.tssap.sap.libs.xmltoolkit_2.0.0/lib/sapxmltoolkit.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/activation.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/jaxm-api.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/saaj-api.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/jaxrpc-api.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/jnet.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/jsse.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.ext.libs.webservices_2.0.0/lib/mail.jar;D:/Programme/SAP/IDE/IDE70/eclipse/plugins/com.sap.tc.webdynpro.model.webservice_2.0.0/lib/_webdynpro_model_webservice.jar;, DynamicProxy.INetProxy.Bypass=, DynamicProxy.INetProxy.Port=8080, DynamicProxy.Javac.path=C:\j2sdk1.4.2_12, DynamicProxy.TempDir=C:\DOKUME1\branch\LOKALE1\Temp\, DynamicProxy.INetProxy.Host=tknproxy}'
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:414)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.readOperationsFromWSDL(WSModelInfo.java:372)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadataInternal(WSModelInfo.java:342)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadata(WSModelInfo.java:306)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.importMetadata(WSModelInfo.java:316)
at com.sap.ide.webdynpro.modeleditor.wizards.model.creation.PageRenameWS.loadNameSpacesAndModelClasses(PageRenameWS.java:435)
at com.sap.ide.webdynpro.modeleditor.wizards.model.creation.ModelDialog.nextPressed(ModelDialog.java:105)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:316)
at org.eclipse.jface.dialogs.Dialog$1.widgetSelected(Dialog.java:423)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:583)
at org.eclipse.jface.window.Window.open(Window.java:563)
at com.sap.ide.webdynpro.modeleditor.ModelEditorCallback.createModel(ModelEditorCallback.java:52)
at com.sap.ide.webdynpro.service.modeleditor.ModelService.createModelWithUI(ModelService.java:70)
at com.sap.ide.webdynpro.service.modeleditor.ServiceWithUI.createModel(ServiceWithUI.java:49)
at com.sap.ide.webdynpro.tsmodel.application.provider.ModelNodeProvider.createUniqueName(ModelNodeProvider.java:55)
at com.tssap.selena.impl.model.elements.EntityImpl.createChildEntityUin(EntityImpl.java:936)
at com.tssap.selena.impl.model.elements.EntityImpl.createChildEntity(EntityImpl.java:502)
at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction.runInternal(CreationAction.java:76)
at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction.access$000(CreationAction.java:24)
at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction$1.run(CreationAction.java:51)
at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:1595)
at com.sap.ide.webdynpro.tsmodel.application.actions.CreationAction.run(CreationAction.java:57)
at com.sap.ide.webdynpro.projectbrowser.actions.PBCreateModelAction.run(PBCreateModelAction.java:95)
at com.tssap.selena.model.extension.action.SelenaActionCollector$GenericElementActionWrapper.run(SelenaActionCollector.java:224)
at com.tssap.util.ui.menu.MenuFactory$MuSiAction.saveRunAction(MenuFactory.java:1425)
at com.tssap.util.ui.menu.MenuFactory$MuSiAction.run(MenuFactory.java:1407)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction.processInternal(MenuFactory.java:616)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction.access$100(MenuFactory.java:586)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction$BusyProcessWorker.run(MenuFactory.java:716)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator.java:69)
at com.tssap.util.ui.menu.MenuFactory$DelegateAction.process(MenuFactory.java:610)
at com.tssap.util.ui.menu.internal.MenuListenerFactory$ProcessAdapter.widgetSelected(MenuListenerFactory.java:172)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:89)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:81)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:840)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:2022)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:1729)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:1402)
at org.eclipse.ui.internal.Workbench.run(Workbench.java:1385)
at com.tssap.util.startup.WBLauncher.run(WBLauncher.java:79)
at org.eclipse.core.internal.boot.InternalBootLoader.run(InternalBootLoader.java:858)
at org.eclipse.core.boot.BootLoader.run(BootLoader.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at com.sap.ide.eclipse.startup.Main.basicRun(Main.java:291)
at com.sap.ide.eclipse.startup.Main.run(Main.java:789)
at com.sap.ide.eclipse.startup.Main.main(Main.java:607)
Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.WebserviceClientException: GenericServiceFactory initialization problem. Could not load web service model. See nested exception for details.
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:150)
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.<init>(DGenericServiceImpl.java:50)
at com.sap.engine.services.webservices.espbase.client.dynamic.GenericServiceFactory.createService(GenericServiceFactory.java:88)
at com.sap.tc.webdynpro.model.webservice.metadata.WSModelInfo.getOrCreateWsrService(WSModelInfo.java:412)
... 53 more
Caused by: com.sap.engine.services.webservices.jaxrpc.exceptions.ProxyGeneratorException: Proxy Generator Error. Proxy generation problem. See nested exception.
at com.sap.engine.services.webservices.jaxrpc.wsdl2java.ProxyGenerator.generateProxy(ProxyGenerator.java:283)
at com.sap.engine.services.webservices.espbase.client.dynamic.impl.DGenericServiceImpl.generateProxyFiles(DGenericServiceImpl.java:147)
... 56 more
Caused by: java.io.IOException: Compilation fails...
C:\Dokumente und Einstellungen\branch\Lokale Einstellungen\Temp\DGenService1207743399620\types\p1\RelationCIShort.java:161: getIdCI() is already defined in types.p1.RelationCIShort
public java.lang.Integer getIdCI() {
^
C:\Dokumente und Einstellungen\branch\Lokale Einstellungen\Temp\DGenService1207743399620\types\p1\RelationCIShort.java:164: hasIdCI() is already defined in types.p1.RelationCIShort
public boolean hasIdCI() {
^
2 errors
THX!
Regards,
Christianfound the fix discussed on this blog... http://kingsfleet.blogspot.com/2008/07/working-round-xsdchoice-binding-issue.html
-
Consuming 3rd Party Web Service - Proxy Generation Error
Hi All,
I am trying to consume a third party Web Service in SE80 and get the below error while completing the steps to configure proxy class.
"Exception Occurred in Configuration Handler"
Uninstantiated object "new child subject" in method
IF_SRT_WSP_SUBJECT_SERVICE~CREATE_BINDING of class CL_SRT_WSP_SUBJECT_SERVICE
The same web service when I try to import in Java it is fine. Has anyone encountered this issue?
Note: I tried both using URL and also saving as local file and its the same error message.
Thanks,
Nagarajan.
The Question is still open.
Edited by: Nagarajan Kumarappan on Oct 10, 2011 9:40 AMThe problem we had was with the web service itself. There were in multiple places we had few definitions repeated which caused the issue. Once we removed it we were good. Use altova xml free for 30 days to check your wsdl. It's great tool to identify issues.
Thanks and good luck !!! -
Creating Web Service Proxy From WSDL - Error SPRX046
We are attempting to create some Web Service proxy objects from some WSDL files. Some of the WSDL files contain message definitions with multiple parts such as
<i><wsdl:message name="GetNewSubmissionsResponse">
<wsdl:part element="impl:Count" name="Count"/>
<wsdl:part element="impl:MoreAvailable" name="MoreAvailable"/>
<wsdl:part element="impl:IRSData" name="IRSData"/>
<wsdl:part element="impl:StateSubmissions" name="StateSubmissions"/>
</wsdl:message></i>
This always generates the error message <b>SPRX046 - "
Msg Proxy generation terminated: Message must have exactly one part".</b>
Is this just a limitation with SAP Web AS? Has anyone dealt with this before? These WSDLs work in other environments (AXIS Java, XML Spy etc).
ThanksIt seems ABAP proxy only supports Document-Literal style WSDL. Document-literal style is supported by most Web services platforms, and is supposed to be most interoperable.
Per WS-I Basic Profile 1.0 (see [1])which provides interoperability guidance of using WSDL1.1, when the message part is defined using the @element attribute, the message can only be bound to so-called "document-Literal" style which in turn requires that the message contains only one part.The WSDL you provided violated the document-literal rules.
Have you tried to change the message definition a bit so it's BP conformant? Try defining a complex type for the subelements, then define an wrapper element to use that complex type, and finally let the message part to refer to the wrapper element. Something like,
<wsdl:message name="GetNewSubmissionsResponse">
<wsdl:part element="impl:GetNewSubmissionsResponseWrapper" name="myResponse"/>
</wsdl:message> -
Web Service Proxy with Dynamic IP and Port
hi,
I am currently looking at the Web Service Proxy generation in JDev 11g. I can generate proxies fine, but the proxies are generated with static host and port. I want to substitute the host and port during runtime if required, for instance read the values from a database. I need to do this to avoid compiling the application for every deployment we make dev, test and production. Is there an easy way to set the generated proxy host and port? Are there any examples?
Thanks in advance!
StephenHi,
Maybe you should have a look on XML Catalogs feature, but I am not sure if JDeveloper support it and how to support it.
-LJ -
Hi,
I have created web service proxy using Jdeveloper 10.1.3. My Jdeveloper is set to JDK 1.4.2_17. I can compile and run this web service proxy fine from Jdeveloper 10.1.3, but as soon as I deploy this to Oracle AS 10.1.2 on unix platform it errors out. This is the error message it gives. Why it doesn't find this class?
500 Internal Server Error
java.lang.NoClassDefFoundError: javax/xml/rpc/ServiceFactory
at aam.easproxy.proxy.InboundMsgSoap12Client.<init>(InboundMsgSoap12Client.java:17)
at index.jspService(_index.java:49)
[SRC:/index.jsp:13]
at com.orionserver[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:350)
at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:509)
at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:413)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ResourceFilterChain.doFilter(ResourceFilterChain.java:65)
at oracle.security.jazn.oc4j.JAZNFilter.doFilter(Unknown Source)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:663)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:330)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:830)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:224)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].server.http.AJPRequestHandler.run(AJPRequestHandler.java:133)
at com.evermind[Oracle Application Server Containers for J2EE 10g (10.1.2.0.2)].util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)
Thanks,
API think that the Web client proxy in JDeveloper 10.1.3 uses Java EE 1.4 libraries which you don't have on OAS 10.1.2.
You might want to look into hosting an OC4J 10.1.3 instance under OAS 10.1.2. -
Error when running Web Service Proxy from JDev (running publisher report)
Hello.
I would like to call publisher report from forms, so i was using this instructions:
http://www.oracle.com/technology/products/xml-publisher/docs/Forms_BIP_v21.pdf
When i test my Web Service Proxy, i get this warning:
WARNING: The received SOAP fault contains non standard fault element: "{http://xml.apache.org/axis/}hostname". This element will be ignored.
javax.xml.rpc.soap.SOAPFaultException: oracle.apps.xdo.webservice.exception.OperationFailedException: PublicReportService::generateReport failed: due to oracle.apps.xdo.servlet.CreateException: Report definition not found:/Path/Employees.xdo
at oracle.j2ee.ws.client.StreamingSender._raiseFault(StreamingSender.java:555)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:396)
at oracle.j2ee.ws.client.StreamingSender._send(StreamingSender.java:112)
at bip_webservice.proxy.runtime.PublicReportServiceSoapBinding_Stub.runReport(PublicReportServiceSoapBinding_Stub.java:290)
at bip_webservice.proxy.PublicReportServiceClient.runReport(PublicReportServiceClient.java:105)
at bip_webservice.proxy.PublicReportServiceClient.main(PublicReportServiceClient.java:79)
What is wrong? Did anyone try those instructions?
Thanks.I am getting the same error. What was the solution that worked for you? Please help
-
Error invoking esb from web service proxy
I have created a web service proxy (with jdeveloper 10.1.3.2) to invoke my service on the ESB.
When i try to invoke this service with the proxy, the following error message appears:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message transmission failure, response code: 500
at oracle.j2ee.ws.client.http.HttpClientTransport.invokeImpl(HttpClientTransport.java:142)
at oracle.j2ee.ws.client.http.HttpClientTransport.invokeOneWay(HttpClientTransport.java:122)
at oracle.j2ee.ws.client.StreamingSender._sendImpl(StreamingSender.java:173)
at oracle.j2ee.ws.client.StreamingSender._sendOneWay(StreamingSender.java:131)
at testproxy.proxy.runtime.__soap_TestIn_execute_ppt_Stub.execute(__soap_TestIn_execute_ppt_Stub.java:88)
When i take a look in the esb console, there i can see, that the service was invoked, but it is signed with the error symbol (i'm writing data into a database and the lines to the database adapter a green, but the lines back are red. But it writes nothing into the database. If i klick on the test webservice button at the appserver, everything works fine).
Does anybody know the reason why it don't work?
thanksIn the ESB Control you can view the exception that's being thrown, is the PrivilegActionException the only stack trace you have?
Maybe you can have a look if the data that's returned from the db-adapter is interpreted correctly by the ESB? You're working with a Request/Reply ESB so you need to make sure that as well the input as the ouput that's returned by the Routing Service is properly defined. -
Generating Ruby Web Service Access Classes from a WSDL
If you have tried to consume a web service from Ruby you surely have noticed how annoying is to write manually all the Ruby code just to invoke a service with complext input parameters' structure:
- You have to know what do the input parameters, their structure and type look like;
- You have to write Ruby classes for them to encapsulate the structures;
- You have to instantiate these classes and pass the objects to the web service proxy class;
- You have to interprete the output parameters.
All this is not impossible of course, but if you are just consumer of the web service and not the developer, if you don't have the exact documentation, you have to read the WSDL description of the service and create the Ruby classes (structures) for the parameters.
Fortunately there is a small, though handy tool, called <b>wsdl2ruby.rb</b>. It accomplishes all these boring tasks for you.
In the following example I will try to show you how <b>wsdl2ruby</b> can be used to generate Ruby classes for accessing a SAP NetWeaver web service, called <b>CreditChecker1</b> (a web service for checking if a person is reliable credit consumer).
To generate the necessary classes we will create a ruby script. Let us name it <b>ws2rgen.rb</b>. Here is what this file looks like:
# Import the wsdl2ruby library.
require 'wsdl/soap/wsdl2ruby'
require 'logger'
# Callback function for the WSDL 2 Ruby generation options.
def getWsdlOpt(s)
optcmd= {}
s << "Service"
optcmd['classdef'] = s
#should work but doesn't, driver name is derived from classname
#if you specify both it breaks, same thing for client_skelton
#optcmd['driver'] = s
optcmd['driver'] = nil
#optcmd['client_skelton'] = nil
optcmd['force'] = true
return optcmd
end
# Create logger.
logger = Logger.new(STDERR)
# Create WSDL2Ruby object and generate.
worker = WSDL::SOAP::WSDL2Ruby.new
worker.logger = logger
# WSDL file location.
worker.location = "http://mysapserver:53000/CreditChecker1/Config1?wsdl"
# Where to generate.
worker.basedir = "temp"
# Set options.
worker.opt.update(getWsdlOpt("Service"))
# Heat.
worker.run
The procedure is straightforward. First we create the WSDL2Ruby object, set its properties <b>location</b> and <b>basedir</b> and then set all other options via the callback function <b>getWsdlOpt()</b>. For further information about these parameters one could consult the source code of wsdl2ruby or contact the developers. Nevertheless the default options are pretty satisfactory. With the last line we start the generation. Two Ruby files will be generated in the <b>temp</b> folder, which is a subfolder of the script's current folder. <b>Please, create the folder "temp" before executing the script.</b>
This generates two files. The first one is <b>CreditChecker1Wsd.rb</b>, containing the necessary data structures:
require 'xsd/qname'
# {urn:CreditChecker1Vi}areReliable
class AreReliable
@@schema_type = "areReliable"
@@schema_ns = "urn:CreditChecker1Vi"
@@schema_qualified = "true"
@@schema_element = [["persons", "ArrayOfPerson"]]
attr_accessor :persons
def initialize(persons = nil)
@persons = persons
end
end
# {urn:CreditChecker1Vi}areReliableResponse
class AreReliableResponse
@@schema_type = "areReliableResponse"
@@schema_ns = "urn:CreditChecker1Vi"
@@schema_qualified = "true"
@@schema_element = [["response", ["ArrayOfboolean", XSD::QName.new("urn:CreditChecker1Vi", "Response")]]]
def Response
@response
end
def Response=(value)
@response = value
end
def initialize(response = nil)
@response = response
end
end
# {urn:CreditChecker1Vi}isReliable
class IsReliable
@@schema_type = "isReliable"
@@schema_ns = "urn:CreditChecker1Vi"
@@schema_qualified = "true"
@@schema_element = [["person", "Person"]]
attr_accessor :person
def initialize(person = nil)
@person = person
end
end
# {urn:CreditChecker1Vi}isReliableResponse
class IsReliableResponse
@@schema_type = "isReliableResponse"
@@schema_ns = "urn:CreditChecker1Vi"
@@schema_qualified = "true"
@@schema_element = [["response", ["SOAP::SOAPBoolean", XSD::QName.new("urn:CreditChecker1Vi", "Response")]]]
def Response
@response
end
def Response=(value)
@response = value
end
def initialize(response = nil)
@response = response
end
end
# {urn:java/lang}ArrayOfboolean
class ArrayOfboolean < ::Array
@@schema_type = "boolean"
@@schema_ns = "http://www.w3.org/2001/XMLSchema"
@@schema_element = [["boolean", ["SOAP::SOAPBoolean[]", XSD::QName.new("urn:java/lang", "boolean")]]]
end
# {urn:com.sap.scripting.test.services.creditchecker.classes}Person
class Person
@@schema_type = "Person"
@@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
@@schema_element = [["age", "SOAP::SOAPInt"], ["name", "SOAP::SOAPString"], ["purse", "Purse"]]
attr_accessor :age
attr_accessor :name
attr_accessor :purse
def initialize(age = nil, name = nil, purse = nil)
@age = age
@name = name
@purse = purse
end
end
# {urn:com.sap.scripting.test.services.creditchecker.classes}Purse
class Purse
@@schema_type = "Purse"
@@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
@@schema_element = [["color", "SOAP::SOAPString"], ["money", "Money"]]
attr_accessor :color
attr_accessor :money
def initialize(color = nil, money = nil)
@color = color
@money = money
end
end
# {urn:com.sap.scripting.test.services.creditchecker.classes}Money
class Money
@@schema_type = "Money"
@@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
@@schema_element = [["amount", "SOAP::SOAPDouble"], ["currency", "SOAP::SOAPString"]]
attr_accessor :amount
attr_accessor :currency
def initialize(amount = nil, currency = nil)
@amount = amount
@currency = currency
end
end
# {urn:com.sap.scripting.test.services.creditchecker.classes}ArrayOfPerson
class ArrayOfPerson < ::Array
@@schema_type = "Person"
@@schema_ns = "urn:com.sap.scripting.test.services.creditchecker.classes"
@@schema_element = [["Person", ["Person[]", XSD::QName.new("urn:com.sap.scripting.test.services.creditchecker.classes", "Person")]]]
end
The second file is <b>CreditChecker1WsdDriver.rb</b>. In it you can find a generated child class of SOAP::RPC::Driver, containing all methods of this web service, so you don't need to add every method and its parameters to call the web service.
require 'CreditChecker1Wsd.rb'
require 'soap/rpc/driver'
class CreditChecker1Vi_Document < ::SOAP::RPC::Driver
DefaultEndpointUrl = "http://mysapserver:53000/CreditChecker1/Config1?style=document"
MappingRegistry = ::SOAP::Mapping::Registry.new
Methods = [
def initialize(endpoint_url = nil)
endpoint_url ||= DefaultEndpointUrl
super(endpoint_url, nil)
self.mapping_registry = MappingRegistry
init_methods
end
private
def init_methods
Methods.each do |definitions|
opt = definitions.last
if opt[:request_style] == :document
add_document_operation(*definitions)
else
add_rpc_operation(*definitions)
qname = definitions[0]
name = definitions[2]
if qname.name != name and qname.name.capitalize == name.capitalize
::SOAP::Mapping.define_singleton_method(self, qname.name) do |*arg|
__send__(name, *arg)
end
end
end
end
end
end
There is a problem with this script, since the <b>Methods</b> array is empty. I suppose it is due to the imports in the SAP NetWeaver WSDL, maybe wsdl2ruby is not mighty enough to handle these WSDL imports. When I succeed in overcoming this, I will post again in this thread to let everybody know.
Message was edited by: Vasil BachvarovHi,
I find Ruby to be really tough to consume SAP WebServices. For simple scenarios like currency conversion may it is good. But for complex scenarios such as Purchase Order entry etc..I found it very annoying to use wsdl2ruby and see that it didnt generate correct proxies.
Until wsdl2ruby is stable enough to support complex datatypes, authentication etc. my recommendation is to use JRuby and use Java Proxies generated by NW Developer studio until pure Ruby's web service support improves.
Following link might be of interest w.r.t wsdl2ruby
http://derklammeraffe.blogspot.com/2006/08/working-with-wsdl2r-soap4r-and-complex.html
Regards
Kiran -
Web service proxy and data control are not working properly
Hi,
I am working on jDeveloper 11.1.1.6
I have a SOA web service which requires 3 inputs and return with a set of data.
When I tried testing that web service in soapUI it is working perfect. But when I have created a web service proxy in my application and trying to test it from class (*******_ptClient) main method everytime it is replying with the output null
Also When I am requesting from the main method SOA is getting proper input (which I am providing in the main method) and SOA is returning proper output I have checked the SOA instance in em. So there is no problem in SOA side.
After that I have created web service data control and tested in that case also it is not showing any result.
What could be the problem ?
Please help.
Thanks
--NavinKHi Shay Shmeltzer,
Thanks for the reply.
I tried in HTTP Analyzer in JDeveloper and there also it is not working. My concern is :-
There are many other web services deployed on the same SOA server in same partition and they are working fine in HTTP analyzer and I am able to create and use the web service proxy as well. So as per my understanding there is nothing like network issues between SOA server and jDeveloper.
1 more thing When I am creating the proxy for this web service and requesting from the proxy's main method SOA is getting proper input (which I am providing in the main method) and SOA is returning proper output I have checked the SOA instance in em. So there is no problem in SOA side. The problem is jDeveloper is not able to get back that response which SOA is returning.
Please Help.
-- NavinK -
Problem while creating web service proxy in Jdeveloper 10.1.3
I am using Jdeveloper 10.1.3 to create a web service proxy so that I can track my request/response in HTTP Analyzer.
I am following the steps as mentioned in the follwoing uRL:
http://www.oracle.com/technology/obe/obe1013jdev/ws/wsandascontrol.htm
But I get the following warning while creating the web servcice proxy:
Generating proxy
WARNING: value type package prefix is ignored for the types defined in the schema that has same target namespace as the target namespace of wsdl: <my web service namepsace>
Proxy generation finished
After adding my code in the main methoad of proxy, I get the following error while compiling:
WARNING: Unable to connect to URL: <my web service proxy URL> due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
Please help as how to solve this.
Edited by: user11258855 on 02-Jul-2009 03:38I am using Jdeveloper 10.1.3 to create a web service proxy so that I can track my request/response in HTTP Analyzer.
I am following the steps as mentioned in the follwoing uRL:
http://www.oracle.com/technology/obe/obe1013jdev/ws/wsandascontrol.htm
But I get the following warning while creating the web servcice proxy:
Generating proxy
WARNING: value type package prefix is ignored for the types defined in the schema that has same target namespace as the target namespace of wsdl: <my web service namepsace>
Proxy generation finished
After adding my code in the main methoad of proxy, I get the following error while compiling:
WARNING: Unable to connect to URL: <my web service proxy URL> due to java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
java.rmi.RemoteException: ; nested exception is:
HTTP transport error: javax.xml.soap.SOAPException: java.security.PrivilegedActionException: javax.xml.soap.SOAPException: Message send failed: Connection refused: connect
Please help as how to solve this.
Edited by: user11258855 on 02-Jul-2009 03:38 -
Error creating web service proxy for bpel process in jdev 10.1.3
Hi,
I am trying to create a web service proxy in Jdeveloper 10.1.3, and get the following error:
Element type "fault" is missing required attribute "name"
I have created a fault on one of the operations, and in the .wsdl file there is a name attribute:
<operation name="process">
<fault name="TestError" message="client:TestErrorMessage"/>
</operation>
The fault definition in the .wsdl obtained from the process when you access it over http is somewhat different:
<fault>
<soap:fault name="TestError" use="literal" encodingStyle="" />
</fault>
Any ideas how to workaround this problem?
TobyHi Susan,
The WSDL generated by BPEL designer is :
<?xml version="1.0" encoding="UTF-8"?>
<definitions name="EncryptedPasswordTest"
targetNamespace="http://xmlns.oracle.com/EncryptedPasswordTest"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:client="http://xmlns.oracle.com/EncryptedPasswordTest"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/">
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TYPE DEFINITION - List of services participating in this BPEL process
The default output of the BPEL designer uses strings as input and
output to the BPEL Process. But you can define or import any XML
Schema type and us them as part of the message types.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<types>
<schema attributeFormDefault="qualified"
elementFormDefault="qualified"
targetNamespace="http://xmlns.oracle.com/EncryptedPasswordTest"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="EncryptedPasswordTestProcessRequest">
<complexType>
<sequence>
<element name="username" type="string"/>
</sequence>
</complexType>
</element>
<element name="EncryptedPasswordTestProcessResponse">
<complexType>
<sequence>
<element name="password" type="string"/>
</sequence>
</complexType>
</element>
<element name="EncryptedPasswordTestProcessError">
<complexType>
<sequence>
<element name="code" type="string"/>
<element name="description" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MESSAGE TYPE DEFINITION - Definition of the message types used as
part of the port type defintions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<message name="EncryptedPasswordTestRequestMessage">
<part name="payload" element="client:EncryptedPasswordTestProcessRequest"/>
</message>
<message name="EncryptedPasswordTestResponseMessage">
<part name="payload" element="client:EncryptedPasswordTestProcessResponse"/>
</message>
<message name="EncryptedPasswordTestErrorMessage">
<part name="payload" element="client:EncryptedPasswordTestProcessError"/>
</message>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PORT TYPE DEFINITION - A port type groups a set of operations into
a logical service unit.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- portType implemented by the EncryptedPasswordTest BPEL process -->
<portType name="EncryptedPasswordTest">
<operation name="process">
<input message="client:EncryptedPasswordTestRequestMessage" />
<output message="client:EncryptedPasswordTestResponseMessage"/>
<fault name="EncryptedPasswordTestError" message="client:EncryptedPasswordTestErrorMessage"/>
</operation>
</portType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PARTNER LINK TYPE DEFINITION
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<plnk:partnerLinkType name="EncryptedPasswordTest">
<plnk:role name="EncryptedPasswordTestProvider">
<plnk:portType name="client:EncryptedPasswordTest"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
And the WSDL produced when you access the ws endpoint is:
<?xml version="1.0" encoding="UTF-8"?>
<definitions
name="EncryptedPasswordTest"
targetNamespace="http://xmlns.oracle.com/EncryptedPasswordTest"
xmlns="http://schemas.xmlsoap.org/wsdl/"
xmlns:tns="http://xmlns.oracle.com/EncryptedPasswordTest"
xmlns:plnk="http://schemas.xmlsoap.org/ws/2003/05/partner-link/"
xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/"
xmlns:client="http://xmlns.oracle.com/EncryptedPasswordTest"
>
<types>
<schema attributeFormDefault="qualified" elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/EncryptedPasswordTest"
xmlns="http://www.w3.org/2001/XMLSchema">
<element name="EncryptedPasswordTestProcessRequest">
<complexType>
<sequence>
<element name="username" type="string"/>
</sequence>
</complexType>
</element>
<element name="EncryptedPasswordTestProcessResponse">
<complexType>
<sequence>
<element name="password" type="string"/>
</sequence>
</complexType>
</element>
<element name="EncryptedPasswordTestProcessError">
<complexType>
<sequence>
<element name="code" type="string"/>
<element name="description" type="string"/>
</sequence>
</complexType>
</element>
</schema>
</types>
<message name="EncryptedPasswordTestErrorMessage">
<part name="payload" element="tns:EncryptedPasswordTestProcessError"/>
</message>
<message name="EncryptedPasswordTestResponseMessage">
<part name="payload" element="tns:EncryptedPasswordTestProcessResponse"/>
</message>
<message name="EncryptedPasswordTestRequestMessage">
<part name="payload" element="tns:EncryptedPasswordTestProcessRequest"/>
</message>
<portType name="EncryptedPasswordTest">
<operation name="process">
<input message="tns:EncryptedPasswordTestRequestMessage"/>
<output message="tns:EncryptedPasswordTestResponseMessage"/>
<fault name="EncryptedPasswordTestError" message="tns:EncryptedPasswordTestErrorMessage"/>
</operation>
</portType>
<binding name="EncryptedPasswordTestBinding" type="tns:EncryptedPasswordTest">
<soap:binding style="document" transport="http://schemas.xmlsoap.org/soap/http"/>
<operation name="process">
<soap:operation style="document" soapAction="process"/>
<input>
<soap:body use="literal"/>
</input>
<output>
<soap:body use="literal"/>
</output>
<fault>
<soap:fault name="EncryptedPasswordTestError" use="literal" encodingStyle=""/>
</fault>
</operation>
</binding>
<service name="EncryptedPasswordTest">
<port name="EncryptedPasswordTestPort" binding="tns:EncryptedPasswordTestBinding">
<soap:address location="http://bpel5.lon.domroot.com:7779/orabpel/default/EncryptedPasswordTest/1.0"/>
</port>
</service>
<plnk:partnerLinkType name="EncryptedPasswordTest">
<plnk:role name="EncryptedPasswordTestProvider">
<plnk:portType name="tns:EncryptedPasswordTest"/>
</plnk:role>
</plnk:partnerLinkType>
</definitions>
Maybe you are looking for
-
Any way to change blob size -- do I need to?
I'm tinkering around with remote blob storage in my dev environment -- doing a lot of different options to see how it really works. One thing I noticed is that when I dragged a file to a document library and it got stored under my filestream filenam
-
10.5.7 No More Accounts w/o Homes?
hi, with 10.5.7 server, i've noticed that one can no longer authenticate to OD accounts unless those accounts have a home directory associated with it. one used to be able to create an account w/o a home and the system would create a "99" folder on t
-
All my preferences suddenly missing? Mail,iTunes,Firefox etc Mac OS X 4.11
Hi there, I own a lovely 7 year-old MacBook Pro, still running OS X 4.11. Before you laugh at me for not upgrading it has worked like a dream and never felt the need to upgrade though am sure I'm missing some good things by not doing so. Anyhow the o
-
Minimum Client Install and Path to TNSNames.ora
1) What files are required for a minimum client install. 2) What is the route/path a program should take to find the tnsnames.ora (Environment variable, registry?) - i.e. how does one locate it? Thanks
-
Problem of Mouse event "JFrom designer"
/* the problem that i can't delete "supprimer" the rows select when i ran the application and this message show up "selectionner un etudiant".please help me.thanks */ private void SupprimerMouseClicked(MouseEvent e) { final int OK_OPTION =