Web Services and JAXRPC serialization encoding

Hi all.
I have written a Web Service starting from the WSDL using wscompile (NetBeans 5.0 feature). The WSDL defines an operation which returns a complex data type which is wrapped by JAXRPC SI in a suitable class package. What I simply do, is to use these classes to create my complex data content. I don't care about the serialization, because it is automatically performed by my Sun Java System Application Server Platform Edition 8.1_01 (build b04-fcs). The default encoding should be UTF-8.
One colleague of mine has tried to connect to my service creating the stub classes using WSDL2Java by Axis. He gets this problem:
java.io.UTFDataFormatException: Invalid byte 2 of 3-byte UTF-8 sequence.
It looks to be a problem of encoding. I think the output is correctly encoded but I'm not sure an I don't know how verify it or setup the Application Server output since almost everything is automatically performed. I've tried to take a look to the generated code inside the Application Server, but it is a bloody mess!
Note that if I try to consume the service using stub client classes generated with wscompile... everything works! My clients generated using Netbeans 5.0 (which uses wscompile) are fine!
Any suggestion?
Thanks

I upgraded webservices developer pack to 1.0 version (final) and I solved my problems!
Pedro Salazar

Similar Messages

  • [jaxrpc] defining web services and WSDL spec

    Greetings,
    I'm starting in JAXRPC web service's concepts and its WSDL specification. After I tested some samples from the jaxrpc tutorial, I tried to make my custom web service, but, I have problems when I deploy the web service and I tried to see in my browser the endpoint url - I got a internal server exception! I pick up the hello sample, I added to it my custom core sample web service functionality - using the same operations, the same signatures methods - and it worked fine!!
    So, what' is wrong? The main difference between them is that I have differents configuration files for xrpcc that will give a wsdl files for each one. Whats changes? The service name? The interface/package name? Is there some kind of limitation in the package name convention with the service names beyound the basic ones in the xrpcc (jaxrpc) specification?
    thanks,
    Pedro Salazar.

    I upgraded webservices developer pack to 1.0 version (final) and I solved my problems!
    Pedro Salazar

  • Web services and unbounded item

    Hi all,
    I'm not able to invoke web services in WD application when there are items with maxOccurs set to unbounded.
    The error is:
    com.sap.engine.services.webservices.jaxrpc.exceptions.XmlMarshalException: XML Serialization Error. Array Property [car] in class [none] must not have NULL elements. This is restricted by schema description.
    In this case item "car" is set in wsdl as
    <xsd:element name="car" minOccurs="0" maxOccurs="unbounded">
    Any ideas?
    thanks
    Andrea

    hi, i�m doing something like you but in jbuilder that is another IDE, i don�t know if it is useful for you but i entered to the help of jbuilder and i wrote in the index "web services" and then i found a topic called : "export classes as webservices" and in that place i can see some steps to follow, may be in eclipse you can find something like this.

  • Web service and servlets in the same project...web.xml?

    Hello, I have a problem with my web service.
    I have a server, which displays a web service. I programmed this service with JAXRPC.
    I have a client, in another directory. I succeded in compiling, deploying and running the web service.
    The problem is that after I tried to integrate this service in an existing project. This project contains servlets. In these servlets, I'm using sessions.
    These servlets are on the same side as the server of the web service. Because of the implementation of my code, I'd like to use in the class that represents the server of the service, the same session as the one I'm using in the servlets.
    But of course, it's not working by itself. I know there's something to do with the web.xml files.
    The thing is that I created a web.xml file for the service, and another for the servlets.
    I was thinking of joining both of them in one xml file, but everything crashes then...
    Could someone tell me how to create a project with a web service and servlets, and mostly how to configure the xml file??
    Thanks for any help
    Philippe

    Hello, I have a problem with my web service.
    I have a server, which displays a web service. I programmed this service with JAXRPC.
    I have a client, in another directory. I succeded in compiling, deploying and running the web service.
    The problem is that after I tried to integrate this service in an existing project. This project contains servlets. In these servlets, I'm using sessions.
    These servlets are on the same side as the server of the web service. Because of the implementation of my code, I'd like to use in the class that represents the server of the service, the same session as the one I'm using in the servlets.
    But of course, it's not working by itself. I know there's something to do with the web.xml files.
    The thing is that I created a web.xml file for the service, and another for the servlets.
    I was thinking of joining both of them in one xml file, but everything crashes then...
    Could someone tell me how to create a project with a web service and servlets, and mostly how to configure the xml file??
    Thanks for any help
    Philippe

  • ASMX web service and The remote server returned an error: (500) Internal Server Error issue

    i have developed a very small web service and which is hosted along with our web site. our webservice url is
    http://www.bba-reman.com/Search/SearchDataIndex.asmx
    web service code
    namespace WebSearchIndex
    #region SearchDataIndex
    /// <summary>
    /// SearchDataIndex is web service which will call function exist in another library for part data indexing
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line.
    // [System.Web.Script.Services.ScriptService]
    public class SearchDataIndex : System.Web.Services.WebService
    //public AuthHeader ServiceAuth=null;
    public class AuthHeader : SoapHeader
    public string Username;
    public string Password;
    #region StartIndex
    /// <summary>
    /// this function will invoke CreateIndex function of SiteSearch module to reindex the data
    /// </summary>
    [WebMethod]
    public string StartIndex(AuthHeader auth)
    string strRetVal = "";
    if (auth.Username == "Admin" && auth.Password == "Admin")
    strRetVal = SiteSearch.CreateIndex(false);
    else
    SoapException se = new SoapException("Failed : Invalid credentials",
    SoapException.ClientFaultCode,Context.Request.Url.AbsoluteUri,new Exception("Invalid credentials"));
    throw se;
    return strRetVal;
    #endregion
    #endregion
    when i was calling that web service from my win apps using
    HttpWebRequest
    class then getting error The remote server returned an error: (500) Internal Server Error
    here is code of my win apps from where i am calling web service
    string strXml = "";
    strXml = "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'><s:Body><StartIndex xmlns='http://tempuri.org/' xmlns:i='http://www.w3.org/2001/XMLSchema-instance'><auth><Username>joy</Username><Password>joy</Password></auth></StartIndex></s:Body></s:Envelope>";
    string url = "http://www.bba-reman.com/Search/SearchDataIndex.asmx";
    HttpWebRequest req = (HttpWebRequest)WebRequest.Create(url);
    req.Method = "POST";
    req.ContentType = "text/xml";
    req.KeepAlive = false;
    req.ContentLength = strXml.Length;
    StreamWriter streamOut = new StreamWriter(req.GetRequestStream(), System.Text.Encoding.ASCII);
    streamOut.Write(strXml);
    streamOut.Close();
    StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
    string strResponse = streamIn.ReadToEnd();
    streamIn.Close();
    i am just not being able to understand when this line execute
    StreamReader streamIn = new StreamReader(req.GetResponse().GetResponseStream());
    then getting the error The remote server returned an error: (500) Internal Server Error
    not being able to understand where i made the mistake. mistake is in the code of web service end or in calling code?
    help me to fix this issue. thanks

    Hi Mou,
    I just tried your win app code about calling web service, but failed. I got the 500 error after I called your service:
    The error message I quoted from Fiddler:
    <?xml version="1.0" encoding="utf-8"?><soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><soap:Body><soap:Fault><faultcode>soap:Client</faultcode><faultstring>System.Web.Services.Protocols.SoapException: Failed : Invalid credentials ---&gt; System.Exception: Invalid credentials
    --- End of inner exception stack trace ---
    at BBAReman.WebSearchIndex.SearchDataIndex.StartIndex(AuthHeader auth)</faultstring><faultactor>http://www.bba-reman.com/Search/SearchDataIndex.asmx</faultactor><detail /></soap:Fault></soap:Body></soap:Envelope>
    I am not totally sure that error occurred by the authentication. But I suggest you can try to add this service into your project using this method below:
    1.right click the Reference and select Add Service Reference
    2.input your service link and click "Go"
    And you can use this service as the following:
    private async void callService()
    ServiceReference1.SearchDataIndexSoapClient client =new ServiceReference1.SearchDataIndexSoapClient();
    var Str= await client.StartIndexAsync(new ServiceReference1.AuthHeader { Username = "Admin", Password = "Admin" });
    Please try it.
    Regards,
    Will
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Web services and servlets in same context

    I would like to provide web services and servlets under the same context, where the servlets are handled by a controller mapped to multiple urls.
    If I map the servlet controller with
    <url-pattern>/servlet</url-pattern>
    then /prjServ/servlet works in a browser but of course any other urls (eg /prjServ/servlet/fred) do not.
    If I change the web.xml to be
    <url-pattern>/servlet/*</url-pattern>
    all attempts to access the servlet get requested resource not available.
    The web service continues to work fine whichever mapping I use for the servlet (the web service is /prjServ/mlm).
    Does the web service handling affect the way I can map the servlets?

    No, it should not. For the JAXRPC SI, the web services are implemented
    via one common servler.

  • Bad XML from external web service and would like to change the content

    I am getting a bad XML(not valid) from external web service and I would like to change the content of the body in OSB proxy service to make it valid.
    For example
    <g:Information xsi:schemaLocation="http:// bad schema" xmlns:g="http://abc.com/t.xsd">
    <test>Test Data</test>
    </g:Information>
    should become
    <g:Information xmlns:g="http://abc.com/t.xsd">
    <test>Test Data</test>
    </g:Information>
    Do you how can I do this?

    I don't think it would be the best solution but you may try -
    1. Conver the incoming XML to string using fn-bea:serialize() function
    2. Replace the not-required content with a blank
    3. Covert the string back to XML using fn-bea:inlinedXML
    If you find any other solution, please let us know.
    Regards,
    Anuj

  • Diff b/w Web service and window service

    What is the difference between web service and window service, whether the both are same or not, Give some explain about that each one and give some examples also.

    An XML Web service is a component that implements program
    logic and provides functionality for diseparate
    applications. These applications use standard protocols,
    such as HTTP, XML, and SOAP, to access the functionality.
    XML Web services use XML-based messaging to send and
    receive data, which enables heterogeneous applications to
    interoperate with each other. You can use XML Web services
    to integrate applications that are written in different
    programming languages and deployed on different platforms.
    In addition, you can deploy XML Web services within an
    intranet as well as on the Internet. While the Internet
    brings users closer to organizations, XML Web services
    allow organizations to integrate their applications.
    A Windows service starts much before any user logs in to
    the system (if it has been setup to start at boot up
    process). A Windows service can also be setup in such a way
    that it requires a user to start it manually ? the ultimate
    customization!
    Windows services run as background processes. These
    applications do not have a user interface, which makes them
    ideal for tasks that do not require any user interaction.
    You can install a Windows service on any server or computer
    that is running Windows 2000, Windows XP, or Windows NT.
    You can also specify a Windows service to run in the
    security context of a specific user account that is
    different from the logged on user account or the default
    computer account. For example, you can create a Windows
    service to monitor performance counter data and react to
    threshold values in a database.

  • Pl/Sql web service and collections not working

    Hello
    I'm trying to create a web service from a function in a package which returns a collection. The creation of the web service and its deployment seem to work correctly. I do get the following warning :
    WARNING: OWS-00077 The Value Type class: pxWsLang.PamLanguagerecordBase does not have a valid JAVA Bean pattern
    but I don't think this is the source of the problem.
    When I try to test the web service using the endpoint in the wsdl I get the following answer in the browser:
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><env:Header/><env:Body><env:Fault xmlns:env="http://schemas.xmlsoap.org/soap/envelope/"><faultcode>env:Server</faultcode><faultstring>Error creating target: pxWsLang.WsLangUser</faultstring><faultactor></faultactor></env:Fault></env:Body></env:Envelope>
    In the DOS window for the OC4J I get the following error :
    2006-11-15 09:21:25.852 ERROR OWS-04005 An error occurred for port: {http://pxWs
    Lang/WsLang.wsdl}wsLangSoapHttpPort: javax.xml.rpc.JAXRPCException: Error creati
    ng target: pxWsLang.WsLangUser.
    The PL/SQL code is as follows :
    Object:
    CREATE OR REPLACE TYPE PAM_LanguageRecord as OBJECT
    NR NUMBER(3),
    SYMBOL VARCHAR2(2)
    Collection:
    CREATE OR REPLACE Type PAM_LanguageTable as Table of PAM_LanguageRecord;
    Package body :
    create or replace package body PAM_TEST is
    function CursorTest return Pam_LanguageTable is
    Res_LangTable PAM_LanguageTable;
    cursor cur is select * from stc_languages;
    begin
    Res_LangTable := new PAM_LanguageTable();
    for Rec in cur loop
    Res_LangTable.Extend(1);
    Res_LangTable(cur%ROWCOUNT) := new PAM_LanguageRecord
    (Rec.NR,
    Rec.SYMBOL
    end loop;
    Return Res_LangTable;
    end;
    end;
    I'm using JDeveloper version 10.1.3.1.0.3984
    How can I get this to work ? (without using Apache Axis or other tools :-)
    Is it supposed to work ?
    Many Thanks
    Paul

    Hi,
    for the "error creating target" problem I found the solution here:
    [WS from a PL/SQL package]: Error creating target
    Hope this helps.
    Regards,
    Patrik

  • Quick questions on the topic of Web Services and EJB POJOs

    I have been reading about Web Services and the data types that are aloud as operation parameters and return types. I was wondering what the standard practice for return types; is it to use the Entity classes straight and customize the WSDL instead of letting the EE container do it (avoid cyclic problems in the schema that can occur when using entity 1-to-many and many-to-1 mappings) or; is it to off load the data into a DTO/VO/Bean and let the EE container take care of all the schema mapping for the WSDL? I look at the EE tutorial and bought a EE book both use very basic examples that do not include connecting to a database or using EJB3 for the data store.
    Thanks for any information

    bump

  • How to connect to external web service and convert XML to a table

    Hi experts,
      I need to connect to external/non-SAP web service and convert XML in that site to a SAP table?
    Is there a function call(SE37) to do this? Is it a must for me to install AS JAVA or PI and configure enterprise service? Please provide a link for me to retrieve relevant infomation, thx.

    No, you don't need PI or the Java stack for this.  You can create an ABAP proxy using the WSDL file for the web service and call the web service using the proxy class in an ABAP program.  You can transform the XML response to internal tables/structures/variables using a transformation template that you create.

  • SQL Server 2008 Reporting Project - Invoke/Consume Web Service and Return Dataset in C# Code-Behind

    Hello,
    I have a Visual Studio 2010 C# class with a method that invokes/consumes a web service and returns an XML dataset. I am traversing through the parent/child nodes and parsing out the data then inserting it into a SQL Server 2008 R2 table for a join within
    another stored procedure. 
    Instead of using a 3rd party API to generate the PDF for this data, I am creating an SSRS report. The formatting will be easier and I can do a RenderFormat directly to PDF.
    Can I expect to be able to transfer the code-behind method to this report and have it be able to work with the web service the same way? It is a SOAP-based web service returning parent nodes and two levels of nested child nodes.
    I have also been researching the approach of calling the web service in the same stored procedure that is currently querying the physical tables (which is used to populate a gridview and PDF) but it looks like it may only be possible with a CLR stored procedure.
    Is it possible to implement a CLR stored procedure within an SSRS report? 
    Hope this makes sense. Any help, suggestion or point in the right direction would be greatly appreciated.
    Thanks,
    Buster

    Hi Buster,
    SSRS supports web service data source, we can call the SOAP-based web service in SSRS report directly. Then, we can use custom code in SSRS to parse the XML data. However, we won’t be able to join another data in SQL Server database.
    Reference:http://technet.microsoft.com/en-us/library/aa964129(v=sql.90).aspx#repservxmlds_topic3
    We cannot implement a CLR stored procedure within an SSRS report directly. In order to execute the CLR store procedure in a SSRS report, we have to execute it as text using the following code:
    Exec <stored procedure name>
    Reference:
    http://dotnetslackers.com/Community/blogs/bmains/archive/2009/01/15/executing-a-clr-stored-procedure-in-reporting-services.aspx
    Hope this helps.
    Regards,
    Alisa Tang
    Alisa Tang
    TechNet Community Support

  • Web services and control characters

    Hi,
    We are using JAXWS and JAXB to create web services. We have a problem with our current data because it sometimes contains "bad" characters, such as control characters. Is there a nice way for us to remove these characters when creating the messages or when retrieving the data from the database? We use java persistence / hibernate to retrieve the data from the database.
    I would prefer a method that doesn't include having to "clean" each string manually...
    Thanks!

    hi, i�m doing something like you but in jbuilder that is another IDE, i don�t know if it is useful for you but i entered to the help of jbuilder and i wrote in the index "web services" and then i found a topic called : "export classes as webservices" and in that place i can see some steps to follow, may be in eclipse you can find something like this.

  • Need advice about web services and Java beans

    Hi
    I am very new to web services and to Java beans as well.
    I am trying to understand if and how a web service can use functionality I have in a Java bean. I couldn't find any documentation I can use.
    For example:
    InitialContext ic = new InitialContext();
    Adder adder = (Adder) ic.lookup("ejb/AdderJNDI");In a EJB client project (I'm working with Eclipse) if I add the EJB project to the build path, the Adder interface is recognized.
    Theoritacally I thought I can do the same in a web service server project, but the Adder interface is not recognized.
    Is there something I can read to understand how I need to use the EJB or implement the web service?
    Many thanks
    Sigal

    Okay....I think I made some errors with the original scenario:
    It basically comes down to this....I think. OCS Calendar has a set of Java classes and methods that provide an abstraction for their web services interface. I know how to create something to use these classes using an IDE like JDeveloper, but I'm not sure how that would work with HTML DB.
    I've noticed that the SQL Workshop has a place for Java sources and classes, and I've heard mentions of PL/SQL wrapping. Is there a way to import classes into an HTML DB workspace, wrap 'em up, and access them via PL/SQL?
    Thanks again,
    Jonathan

  • Load balancing SMA web service and SMA end point URL

    Hi,
    We have set up the recommended 3 servers with Azure Pack, SMA Web Service and Runbook Worker.  We are now wanting to configure the Azure pack portal to setup the SMA endpoint url for the web service.  Before we do that, we are assuming we should
    load balance the web services to answer on 1 url (ie, smaws.domainname.com).
    1. Is there any guidance or things to consider when load balancing the 3 web services to answer to 1 url.  We will probably use f5 since that is what we use.
    2. The end point url that we configure for Azure Pack automation should be this load balanced URL correct?
    3. Should we have the Azure pack installed on just one of the servers or all 3.  We did all 3 but it seems like server2 and 3 just redirect to 1 anyway so I am assuming the URL for Azure pack is stored in a db somewhere.
    4. Are there any other components of SMA/Azure Pack that should also be load balanced?
    Thanks
    Thanks Lance

    So in this case you need to register the SMA Runbook Workers (do this on machine 1):
    $webService
    = "https://localhost"
    $workers
    = (Get-SmaRunbookWorkerDeployment
    -WebServiceEndpoint
    $webService).ComputerName
    if($workers
    -isnot [system.array]) {$workers
    = @($workers)}
    $workers
    += "MachineName2"
    $workers += "MachineName3"
    New-SmaRunbookWorkerDeployment
    -WebServiceEndpoint
    $webService -ComputerName
    $workers

Maybe you are looking for