Web Service Proxy Class: Message class does not recognize xs:restriction
Hi,
I have a use case where I need to consume a published web service. The request message of the published web service has quite a few elements which are defined using the xs:restriction tag. For example:
<xs:element maxOccurs="1" minOccurs="0" name="EMPLID">
<xs:annotation>
<xs:documentation xml:lang="en">Empl ID</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="11"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" name="BIRTHDATE">
<xs:annotation>
<xs:documentation xml:lang="en">Date of Birth</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:date"/>
</xs:simpleType>
</xs:element>
<xs:element maxOccurs="1" minOccurs="0" name="BIRTHPLACE">
<xs:annotation>
<xs:documentation xml:lang="en">Birth Location</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:maxLength value="30"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
The problem is that the message class that is generated for the request message does not create properties for these elements. Hence no accessor methods are generated either. This makes it impossible to set the message data. Unless I guess we code the entire thing manually.
Does anyone know of a better workaround ?
Looks like this was a false alarm. There were some issues with the message schema.
Sorry for the confusion.
Similar Messages
-
I cannot send e mails on my iphone 4, receiving is o.k. I get error message "server does not recognize recipient"
Have you check to make sure the email address is correct?
-
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 -
Create Web Service Proxy - Union Schema Element has not been implemented
Create Web Service Proxy
Validation Failed:
WSDLException: faultCode=INVALID_WSDL: unsupported XML Schema feature(Union Schema Element has not been implemented)
WSDL source: http://personal.inet.fi/cool/sports/misc/FlatWSDL/SOAPFrontGetShowBalanceJMS.wsdlLooks like this was a false alarm. There were some issues with the message schema.
Sorry for the confusion. -
Web Service Call with Basic Authentication does not work
If I try to use Basic Authentication in my Web Service Client with the automatically created methods
setUsername(inUserName)
setPassword(inPassword)
setAddress(inAddress)
the application does not make a call. Did I forget something?
Is it possible to use "Test Method" with Basic Authentication?
Thank you.Thank you for your answer.
But: I already read this article. And it doesn't help me.
I use the following code:
getMyServiceClient1().setUsername(inUserName);
getMyServiceClient1().setPassword(inPassword);With this code I always get a java.lang.NullPointerException.
The methods setUsername and setPassword are definded as follows:
public void setUsername(String inUserName) {
myStub._setProperty(Stub.USERNAME_PROPERTY, inUserName);
public void setPassword(String inPassword) {
myStub._setProperty(Stub.PASSWORD_PROPERTY, inPassword);
}But if I look at the methods which are generated automatically by Sun Java Studio Creator I cannot find _setProperty.
I also found this thread in your forum:
http://swforum.sun.com/jive/thread.jspa?forumID=123&threadID=54773 -
Java Web Service Deployed on App server does not run
hi,
I created a java web service and deployed it on my Application server. When i open the enterprise manager i find my webservice there. I click on test web service and it gives me two options one with a 4443 port and other with a 7777 port. It picks up a 0.0.0.0 hostname though i deplyoed it on to a different machine.
I choose to use the 7777 port and test the web service whrn i click invoke it give me the error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
and when using the 4443 port it gives me the error as
"SSL Error: unable to find valid certification path to requested target"
please suggest how i can test a simple java webservice.
Thanks
SravantiI think the problem is to add the custom dll files while deploying the application. Could any one please suggest how i can add custom dll file for deployment?
Thanks
Sravanti -
I can not send a web page as a message. Does not send.
When sending a picture from camera roll or from a web page the message will not send since the new update.
Clear the cache and the cookies from sites that cause problems.
"Clear the Cache":
*Firefox > Preferences > Advanced > Network > Offline Storage (Cache): "Clear Now"
"Remove Cookies" from sites causing problems:
*Firefox > Preferences > Privacy > Cookies: "Show Cookies"
Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance/Themes).
*Don't make any changes on the Safe mode start window.
*https://support.mozilla.org/kb/Safe+Mode
*http://kb.mozillazine.org/Error_loading_websites
*https://support.mozilla.org/kb/Error+loading+web+sites -
Business Tier / Web Services / Web Services Proxy does not exists
Hi,
from the documentation:
'To call a web service from an application module, you perform three steps:
1. Create a web service proxy class for the web service.
2. Create an instance of the web service proxy class in your application module.
3. Invoke one or more methods on the web service proxy object.'
The web service proxy is supposed to be under 'New / Business Tier / Web Services / Web Services Proxy', but all I have in the item-list is the 'UDDI Registry Connection', no 'Web Services Proxy'. Does anyone know how to get the 'Web Services Proxy' as an item in the Web-services gallery ?
I'm running JDeveloper 10.1.3.3.0 Studio Edition.
Regards
ErikOh boy. Nope. But I did now ! And there it is, just like magic...
I totally overlooked that field. Thanks, I am a bit new to this, needless to say !
Regards
Erik -
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 in OAF project
Hi
I am trying to create a Web Service proxy class that I can use to call a web service from a custom OAF page.
I am doing this by right clicking on the OAF project (12i project using 10.1.3.3.0.3 of JDev with OAF ext) and choosing New -> Web Services -> Web Service Proxy.
In doing so I get the 'Create Web Service Proxy' wizard and can choose the wsdl which I have downloaded locally. On choosing the wsdl (Search.wsdl) saying the following error -
The name .proxy.SearchSoapImpl is not a valid java class name.
If however I create a New empty project (not OAF) and follow the same steps it creates the proxy and its classes successfully.
I am assuming i can now include these in my OAF project, but wondered if anyone has seen this error and if so is there a reason as to why you can create the proxy in an OAF project.
Is the approach correct above??
RobertOK no-one appears to be commenting on this..
I've got this working by creating my proxy class in a new OAF project and including it in the project that will be calling it. -
Can I load Java classes generated by the Web Service Proxy Wizard?
Hi gurus,
I am very new to Oracle JDeveloper and I have mainly used it to create and debug PL/SQL procedures. My client app is written in PowerBuilder 11 (Sybase), which claims that it will create a datawindow from a web service. Well, it turned out that PB can only handle simple stuff (it works with a very simple wsdl from the internet) but can't handle more complex ones that we need to use. So I am thinking about using JDev to create the web service proxy for the web service and then load it into Oracle as a Java stored procedure so that PowerBuilder can call the procedure. JDev succsfully generated the proxy and a few Java classes. My question is, do I need to load all the classes into the database? If yes, will the reference to the package work? For example, in a JDev generated class (the soap client class), it has package MyJdev.proxy; at the top. Or, will it work if I load all the classes included in package /MyJdev/proxy into the database?
Thank you very much for any help.
BenThanks again, Bruce.
What I meant by SOAPElement is that one genereated Java class has this and this class also has the setter for this like this,
public void setSelection(javax.xml.soap.SOAPElement selection) {
this.selection = selection;
And here is the whole class,
public class CaseSearchByPartyRequest implements java.io.Serializable {
protected java.lang.String schemaVersion;
protected java.util.Calendar messageProducedDateTime;
protected javax.xml.soap.SOAPElement selection;
protected Restriction restriction;
public CaseSearchByPartyRequest() {
public java.lang.String getSchemaVersion() {
return schemaVersion;
public void setSchemaVersion(java.lang.String schemaVersion) {
this.schemaVersion = schemaVersion;
public java.util.Calendar getMessageProducedDateTime() {
return messageProducedDateTime;
public void setMessageProducedDateTime(java.util.Calendar messageProducedDateTime) {
this.messageProducedDateTime = messageProducedDateTime;
public javax.xml.soap.SOAPElement getSelection() {
return selection;
public void setSelection(javax.xml.soap.SOAPElement selection) {
this.selection = selection;
public Restriction getRestriction() {
return restriction;
public void setRestriction(Restriction restriction) {
this.restriction = restriction;
this.selection is the request that I think I need. And here is the static main method of the soap client class genereated.
public static void main(String[] args) {
try {
MyJdev.proxy.SoapClient myPort = new MyJdev.proxy.SoapClient();
System.out.println("calling " + myPort.getEndpoint());
// Add your own code here
} catch (Exception ex) {
ex.printStackTrace();
So, if I need to send the request to the web service, do I need to create the request, correct? I have done it through AQ and Messaging Gateway and works fine by manually creating the request xml in PL/SQL, but now I need to get it to work sychronously from the UI. I believe that I need the request (SOAPElement) because that is the only way that I can supply the parameters. I have not see any setters for the parameters other than some setters for user name and password.
Did I get something wrong here? If I don't supply the "selection", will JDev do it?
Thanks.
Ben -
Web service proxy client class missing
Hi,
I am using Jdev 11g.
I created web service proxy but I cannot find a client class.
Where is a client class jdev created?
This is jdev help I refered;
Designing and Developing Applications > Developing with Web Services > Using Existing Web Services in Applications > Creating Web Service Proxies > Using Web Service Proxies
ThanksHi,
I created a client class with jdev10134 and put class in my jdev11g project.
I got following error when run client class
Exception in thread "main" java.lang.Error: Jaxrpc 1.1 method is not supported.
at weblogic.webservice.core.rpc.ServiceFactoryImpl.loadService(ServiceFactoryImpl.java:65)
I found this thread.
"Jaxrpc 1.1 method not supported" when running jdev ws-proxy on weblogic
I checked WLS10.3 release note, it seems supported.
Please could someone help me?
Thanks
Edited by: user10445424 on 2008/11/10 17:21 -
Web Service Proxy not returning Response in 11g
Hi,
I am facing a difference in the creation of Web Service Proxy in 11g when compared to 10g. I have exposure of creating a Web Service Proxy in 10g and I do observe that the folder name 'runtime' gets generated automatically along with the proxy at the time of creation.
But in 11g, the nature & behavior of Web Service Proxy creation has changed a lot according to my observation. I am facing an issue where the response object is not returning the expected results as per the functionality.
In 10g, we have used a Stub class (automatically created under 'runtime' folder) and we are able to put some logs to see the request and response object in the form of 'xml'. But in 11g, I am facing difficulty in getting the same logged to see the response from OPA.
Please share your thoughts which would definitely help me in resolving this issue.
With Regards,
Thiyagarajan VHi,
I have also tried using 'Web Service Data Control' as an alternate method to overcome the above mentioned issue. But I have ended up the error "DCA-29000: Unexpected exception caught: java.lang.NullPointerException,msg=null" and failed to create a data control.
The JDeveloper version which I am using is 11.1.1.5.0. I also came to know that there is a patch (9790388) which has resolved this bug in JDeveloper. I also applied the same patch in my Oracle Home using OPatch utility.
But unfortunatley, the version suitable for this patch is 11.1.1.4.0 and I suspected that could be one of the reason that the problem has not got resolved yet.
Please suggest the patch or any solution which can also help me in resolving this issue. I really appreciate your time and effort in sharing your thoughts for the problems which I have mentioned over here.
Thank you !!!
With Regards,
Thiyagarajan V -
OAAM web services implementation class for WebSphere 6.1
Hi All,
My client is running OAAM 10.1.4.5 and looking to migrate to WebSphere 6.1. I'd like to replace the (default) Apache Axis web services implementation class with a custom-built WebSphere 6.1 implementation class. Does anyone have any code they'd been willing to share?
Regards,
StevenIt is may be because BO is not ready for Java 2 and you can find more info about readyness of applications at
http://publib.boulder.ibm.com/infocenter/wasinfo/v6r0/index.jsp?topic=/com.ibm.websphere.nd.doc/info/ae/ae/csec_rsecmgr2.html
I am not sure if BO is prepared for the very fine-grain access control programming model that Java 2 security is capable of enforcing.
May be some one from PG should be able to answer readyness of BO with Java2.
-Gokul. -
Simple JSP does not recognize class(FaqCatagories)
The following is a simple welcome.jsp file that I am trying to run on a local J2EE sever. As you can see it tries to import classes one being the FaqCategories.class which is located in the folder Ch03 of the WEB-INF directory. When I call the page up on the browser It gives me that it does not recognize the FaqCategories faqs = new FaqCategories; class error. I am wondering why(Is the import statement wrong? Did I put the class in the wrong directory? Etc... I followed everything the book told me to a que and I still received an error. <&@ page errorPage="/WEB-INF/errorPage.jsp" import="java.util.Iterator,Ch03.FaqCategories" %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Java FAQ Welcome Page</title> </head> <body> <h1>Java FAQ Welcome Page</h1> Welcome to the Java FAQ <%! FaqCategories faqs = new FaqCategories(); %> Click a link below for answers to the given topic. <% Iterator categories = faqs.getAllCategories(); while(categories.hasNext()) { String category = (String) categories.next(); %> <a href="<%= replaceUnderscore(category) %>.jsp"><%= category
%></a> <% } %> <%@ include file="/WEB-INF/footer.jspf" %> </body> </html> <%! public String replaceUnderscore(String s) { return s.replace(' ','_'); } %>FaqCategories.class which is located in the folder Ch03 of the WEB-INF directory.You mean "FaqCategories.class which is located in the folder Ch03 of the WEB-INF/classes directory."
Maybe you are looking for
-
My Epson Stylus RX700 is no longer supported...any ideas?
Upgraded to Lion today and can't get my Epson Stylus RX700 scanner to open anymore b/c "PowerPC applications are no longer supported"...and doesn't seem to have what I need on the Epson page...
-
Find text from a file and set it as a variable in applescript?
I am trying to build a script that sends me updates and notifications from cex.io. Please keep on reading below, so I may guide you until the point I have trouble with. The first simple script in this operation goes to cex.io's trading page for BTC/G
-
MacBook Pro Retina Audio issue after upgrade to Mountain Lion
Got my new MacBook Pro with Retina display just over a week ago now and was working brilliantly up until last night. I upgraded to Mountain Lion via the App store as I already bought it for my other macs and didnt wish to wait to redeem my free copy.
-
Is it possible to run photoshop elements 4.0 and premier 2.0 on Windows 7?
Is it possible to run photoshop elements 4.0 and premier 2.0 on Windows 7?
-
Doubt with Enterprise Services
Hi gurus!! I have found on the Enterprise Service Workplace the Service operation 'Find Contact Person by Name and Workplace' of the Enterprise Service Interface 'Query Business Partner' from CRM. I want to consume the Enterprise Service through XI,