Attachments in web services

hi all,
I posted my msg last week , i like to post it again because its not solved.thanks.
I am runing the example for attachment
"http://dev2dev.bea.com/managed_content/direct/webservice/swaParam.zip"
& i am getting this error, saying its wrong no. of arguments, but i have checked its rite in the example have anyone tried...
run:
[java] From server::helloWorld
[java] java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultExc
eption: wrong number of arguments; nested exception is:
[java] javax.xml.rpc.soap.SOAPFaultException: wrong number of arguments
[java] javax.xml.rpc.soap.SOAPFaultException: wrong number of arguments
[java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOpera
tion.java:459)
[java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOpera
tion.java:359)
[java] at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:2
25)
[java] at examples.webservices.basic.attach.MyServicePort_Stub.echoAtta
chment(MyServicePort_Stub.java:33)
[java] at examples.webservices.basic.attach.Client.main(Client.java:22)
[java] Exception in thread "main"
Thanks
Diwa

Hello,
When you deployed the "attach.war" and used the browser to look at the test page: http://localhost:7001/attach/MyService do you
see two operations: echoAttachments and helloWorld? When you select helloWorld, and do the Invoke, does it display the soap
request/response?
Could you do a "java weblogic.version"
Are you using WLS v7.0 SP1?
Thanks,
Bruce
Diwa wrote:
hi all,
I posted my msg last week , i like to post it again because its not solved.thanks.
I am runing the example for attachment
"http://dev2dev.bea.com/managed_content/direct/webservice/swaParam.zip"
& i am getting this error, saying its wrong no. of arguments, but i have checked its rite in the example have anyone tried...
run:
[java] From server::helloWorld
[java] java.rmi.RemoteException: SOAP Fault:javax.xml.rpc.soap.SOAPFaultExc
eption: wrong number of arguments; nested exception is:
[java] javax.xml.rpc.soap.SOAPFaultException: wrong number of arguments
[java] javax.xml.rpc.soap.SOAPFaultException: wrong number of arguments
[java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOpera
tion.java:459)
[java] at weblogic.webservice.core.DefaultOperation.invoke(DefaultOpera
tion.java:359)
[java] at weblogic.webservice.core.rpc.StubImpl._invoke(StubImpl.java:2
25)
[java] at examples.webservices.basic.attach.MyServicePort_Stub.echoAtta
chment(MyServicePort_Stub.java:33)
[java] at examples.webservices.basic.attach.Client.main(Client.java:22)
[java] Exception in thread "main"
Thanks
Diwa

Similar Messages

  • Adding attachments to web service

    Hi,
    I am working on a project which requires me to add pictures as attachments of a web service.
    This is what I do:
    messageContext = endpointContext.getMessageContext();
    SOAPMessageContext soapContext = (SOAPMessageContext) messageContext;
    SOAPMessage msg = soapContext.getMessage();
    //URL url = new URL("file:///attachments/jhe061.gif");
    URL url = new URL("http://www.google.ro/images/hp0.gif");
    DataHandler dataHandler = new DataHandler(url);
    AttachmentPart attachment = msg.createAttachmentPart(dataHandler, "image/gif");
    attachment.setContentId("image/gif");
    msg.addAttachmentPart(attachment);
    According to the J2EE tutorial, an image attachment should be added to the service. On the client side no sign of a multipart is found....
    Could anybody tell me what I do wrong?
    Thanks, d3m0

    Attachment support for webservices is not defined using the mime binding in the
    current jaxrpc1.1 implementation. It is done in an implementation specific manner.
    See the jaxrpc1.1 specfication chapter 7 where it talks about SOAP messages with
    attachments. This is optional functionality in the jaxrpc1.1 release.
    In jaxrpc1.1.2 (a follow on release) support for WS-I Attachment Profile1.0 is
    in this release defined via the wsdl mime binding. You can get this release by
    downloading the JWSDP1.4 release. This contains the required attachment support
    you need for handling attachments in webservices in a portable way. To create
    a webservice with attachments using this release is quite easy. You simply
    define your attachments in your wsdl using the wsdl mime binding. You can send
    attachments to a webservice in the SOAP request by defining the mime binding
    on the operation input and you can get attachments back from the webservice by
    defining the mime binding on the operation output. You will need to look at
    at the WS-I Attachment Profile 1.0 Specification to see how this is done.
    Also look at the documentation and release notes for the JWSDP1.4 release.
    Here is an example of the mime binding for a webservice operation on the
    output.
    <binding name="SwaTestSoapBinding1" type="tns:SwaTest1">
    <soap:binding transport="http://schemas.xmlsoap.org/soap/http" style="rpc"/>
    <operation name="getMultipleAttachments">
    <soap:operation/>
    <input>
    <soap:body parts="request" use="literal" namespace="http://SwaTestService.org/wsdl"/>
    </input>
    <output>
    <mime:multipartRelated>
    <mime:part>
    <soap:body parts="response" use="literal" namespace="http://SwaTestService.org/wsdl"/>
    </mime:part>
    <mime:part>
    <mime:content part="attach1" type="text/plain"/>
    </mime:part>
    <mime:part>
    <mime:content part="attach2" type="text/html"/>
    </mime:part>
    </mime:multipartRelated>
    </output>
    </operation>
    An example of using attachments in jaxrpc1.1:
    To do attachments in jaxrpc1.1 you can start from java and develop an SEI with
    signatures as follows:
    Sample SEI
    package attachmentstest;
    import java.rmi.Remote;
    import java.rmi.RemoteException;
    import java.awt.Image;
    import javax.mail.internet.MimeMultipart;
    import javax.xml.transform.Source;
    import javax.activation.DataHandler;
    import java.util.*;
    // Service Defintion Interface - as outlined in JAX-RPC Specification
    public interface AttachmentsTest extends Remote {
    public Image echoImage(Image v) throws RemoteException;
    public Image[] echoImageArray(Image[] v) throws RemoteException;
    public MimeMultipart echoMimeMultipart(MimeMultipart v) throws RemoteException;
    public MimeMultipart[] echoMimeMultipartArray(MimeMultipart[] v) throws RemoteException;
    public Source echoSource(Source v) throws RemoteException;
    public Source[] echoSourceArray(Source[] v) throws RemoteException;
    public DataHandler echoDataHandler(DataHandler v) throws RemoteException;
    public DataHandler[] echoDataHandlerArray(DataHandler[] v) throws RemoteException;
    Sample Client
    private boolean dataHandlerTest() {
         TestUtil.logMsg("AttachmentsTest:(dataHandlerTest)");
         boolean pass = true;
         DataHandler response;
    try {
    DataHandler dataHandler = new DataHandler(sourceFileURL);
         TestUtil.logMsg("Test request/response of DataHandler ...");
         TestUtil.logMsg("dataHandler="+dataHandler);
         response = port.echoDataHandler(dataHandler);
         if (!(response.getContent().equals(dataHandler.getContent()))) {
              TestUtil.logErr("DataHandler comparison mismatch");
              pass = false;
    } catch (Exception e) {
         TestUtil.logErr("Caught exception: " + e.getMessage());
    TestUtil.printStackTrace(e);
         pass = false;
         printTestStatus(pass, "AttachmentsTest:(dataHandlerTest)");
         return pass;
    private boolean sourceTest() {
         TestUtil.logMsg("AttachmentsTest:(sourceTest)");
         boolean pass = true;
         Source response;
    try {
    Source source = new StreamSource(xmlFileURL.openStream());
         TestUtil.logMsg("Test request/response of Source ...");
         response = port.echoSource(source);
         // Code for comparison here
    } catch (Exception e) {
         TestUtil.logErr("Caught exception: " + e.getMessage());
    TestUtil.printStackTrace(e);
         pass = false;
         printTestStatus(pass, "AttachmentsTest:(sourceTest)");
         return pass;

  • Adding attachments to Web Service call

    Hi
    Does Bea's web service classes include support for adding attachments to the soap message sent by a web service?
    How do I do it? or otherwise, how do I get through the abtraction down to the soap message so I can add it manually?
    I have both a weblogic.webservice.core.rpc.StubImpl and a javax.xml.rpc.Service to work with, I'm guessing it's somewhere deep down in the context of the Service...?

    Hi
    Does Bea's web service classes include support for adding attachments to the soap message sent by a web service?
    How do I do it? or otherwise, how do I get through the abtraction down to the soap message so I can add it manually?
    I have both a weblogic.webservice.core.rpc.StubImpl and a javax.xml.rpc.Service to work with, I'm guessing it's somewhere deep down in the context of the Service...?

  • How to send Attachments vis web service response?

    Have created a custom plsql type webservice.
    How do we send a file(say a blob object) as an attachment?
    Cannot be sent as a blob object return parameter.
    Any body have encountered this requirement?

    Hi Abdullah,
    this is only possible if there is an extension scenario for the Query "Outbound" available. You added already the "Inbound" Query but I am pretty sure that there is a second scenario for the QueryCustomerIn for the "Outbound".
    Just check out the available options of the process extension scenario you are using already and you will find it. Check it, activate your xbo and the response should also have your field
    Cheers,
    Jens

  • LV2012 Web Services w/ NI Auth login not working w/ static files in Firefox 19

    Hi!
    I followed this procedure to password protect my web service and the static files. 
    http://digital.ni.com/public.nsf/allkb/DF41D5DA8EEB4840862577D90058C208
    When testing it out with my web service it seems to work fine on any web browser.  http://localhost:8080/add/add/1/2 first will present a login.  Once the user is logged in the page refreshes and the results of the operation are shown.  http://localhost:8080/logout works as well.
    I followed the procedure in the FAQ to include an index.html file.
    http://www.ni.com/white-paper/7747/en#toc15
    When I try to access the page (via http:localhost:8080/add/web/index.html) I'm greeted with the National Instruments login screen.  I enter my credentials and in Chrome and Internet Explorer the screen refreshes and I see my html file.  In Firefox it hangs for awhile on the authentication screen and then reloads back to the authenticaiton screen (as if the username and password did not take).
    Attached are my files.  If you want to try and recreate this please follow this procedure:
    * Unzip the attached project to a folder
    * Open the project in LabVIEW 2012
    * Check the properties of the web service to ensure that the build paths are correct
    * Follow the procedure above for setting up NI Auth on your web service and adding the "testpermission2" permission.  Be sure to remove "Everyone" from that "testpermission2" or you will never see a login prompt.
    * Build/Deploy the web service
    * open http://localhost:8080/logout to ensure that you are not currently authenticated
    * open http://localhost:8080/add/add/1/2 and login, observe behavior
    * open http://localhost:8080/add/web/index.html you should still be logged in so you will see the "Hello World!" just fine
    * open http://localhost:8080/logout to log back out
    * open http://localhost:8080/add/web/index.html and see if you are able to login.
    I've tried disabelling my plugins in Firefox and still have this problem.  I'm really scratching my head on how to overcome this other than throwing away NI Auth and use something else.  My web service is going to run off of a static front end driven by javascript and html.  So the access point will be the html file.  I need to have some username and password scheme worked out.  I also need to be able to see what user is currently logged in with my Web Service VIs (does anyone know if that is possible with NI Auth)? 
    The other BIG issue I have with NI Auth is that it requires Silverlight.  So much for mobile support, eh?  Anyone know of a good plug-and-play alternative so I don't have to reinvent the wheel?  I guess I could impliment some kind of token system on my web service side.
    In the meantime, getting NI Auth to properly work with Firefox would help.
    Thanks for your input,
    -Nic
    Attachments:
    Example Web Service.zip ‏15 KB

    Disclaimer: I in no way mean to bash NI and I have used NI Auth myself in the past
    If you are going to go to the trouble of abstracting NI Auth, I would recommend instead investing your time in your own authentication scheme (or implementing a standard scheme in LV).
    NI Auth is great and works for low security applications where you just don't want people fooling around with your application who shouldn't be.
    However, NI Auth is really not that secure.  If I remember correctly, the username is transmitted in plain text and I don't think the encryption algorithm is that sophisticated.  It is nice that it's already integrated into LV, but there really are very few features at this time.
    If you want something to be really secure, you need to take measures beyond what NI Auth provides and before you go to the work of building abstraction on top of a basic and somewhat shaky protocol, I'd seriously consider implementing a more stable base.
    <insert 2 cents complete>
    Chris
    Certified LabVIEW Architect
    Certified TestStand Architect

  • Error occurs when i try to install a built application containing Web services VIs

    Hello,
    at the moment i am trying to create and install a built application containing a Web server and Web services VIs. I did the steps as described here: http://www.ni.com/white-paper/7747/en#toc13
    But when I install my application on the target PC the following error occurs after the installation:
    Error2: Failed to perform action
    "[LV2011RTEDIR]LVWS\NILVWSPostInstallerScript.exe"
    "[ProgramFilesFolder]DeployWebServices\Webservice.lvws"
    What did I do wrong? The project example is attached
    Development system: LV2011 SP1, WIn7
    Target PC: Win7, no LabVIEW, but ALL possible additional installer/run-times installed
    Thanks,
    Elmar
    Certified LabVIEW Developer
    www.merecs.de
    Attachments:
    Deploy Web Services.zip ‏20 KB

    Hi,
    long time ago, but I can remember. You have to copy a folder.
    e.g. I have the file in C:\Program Files (x86)\National Instruments\Shared\LabVIEW Run-Time\2013\LVWS , but there is no LVWS folder in \Shared\LabVIEW Run-Time\2012
    (I have a new computer, and for some reason I'm also missing the file in the LV2012 folder now.)
    Try to copy from another version to 2012 U(or download my fzip). I also don't now, why it is missing. Maybe something during the LV2012 installion was wrong.
    Hope I could help,
    Elmar, CLD
    Certified LabVIEW Developer
    www.merecs.de
    Attachments:
    LVWS.zip ‏688 KB

  • Certain data missing from Web service output in LV8.5.1

    I just installed Labview 8.5.1 and thereby got rid of a problem where the Import Web Service Wizard hung.
    However, a new problem appeared. The XML output of my web service call does not contain the actual result values. When I call the web service using SOAPUI from http://www.soapui.org/, I can see the actual result values in a section of the XML output called diffgr:diffgram. When I inspect the Labview XML output, the whole diffgram section is missing! Se attachments.
    Any help appreciated!
    Attachments:
    SOAPUI Web Service output2.txt ‏3 KB
    Labview Web Service output1.txt ‏1 KB

    It is on our company's intranet. The description in wsdl-format is attached.
    (You might have to save it as a .txt file on your hard drive in order to view it with Notepad.)
    Message Edited by andreas nilsson on 04-23-2008 05:47 AM
    Attachments:
    Axaptaws_wsdl.txt ‏146 KB

  • Web services in Flex

    Hi all,
    I am trying to figure out if there is a way to send / receive
    file attachments using web services. I have read a bit about
    converting attachments using Base64 to convert binary to text. I am
    hoping there is a better way to do this as most of my file
    attachments are fairly good size.
    Any thoughts? Samples? etc . .
    Thanks,
    STeveR

    Hi,
    Currently, Flash Player 9 does not let you access the
    contents of a file on the client side (though this is possible in
    AIR / Flash Player 10). Once you have access to the file contents,
    you can use Base64, hex encoding etc.
    DIME is an alternative. But Flex has no API support for it.
    You could submit a feature request at
    http://www.adobe.com/go/wish
    or try extending
    SoapEncoder
    to support DIME.

  • Web Service to Create a Document Info Record with attachments (e.g. PDF)

    Hello guys,
    we are looking forward to create a Web Service that should be able to create a Document Info Record on SAP ERP Application Server. As we don't have installed the SAP Standard Web Services on our SAP ERP ECC 6.0 system we will manually create a Web Service with the help of the standard BAPI_DOCUMENT_CREATE2.
    The current problem is that the Web Service based on the Standard BAPI can not upload Files (PDF or Word files) from the Users Client PC to the Application Server.
    Is there a possibility to Create a Web Service that can handle files and create DIRs on application server?
    Thanks a lot!!
    Regards,
    Christian

    Hello Natallia,
    Well, in this case you don't really need the CV01N transaction. This represents the user interface (UI), and you only need an interface (that is, an API), which in SAP is represented by a BAPI
    I'm not familiar with CRM, but I assume that at some point when saving a Service Contract, you have a BAdI, where you can check the status and insert some custom code.
    So, all you have to do is call BAPI_DOCUMENT_CREATE or BAPI_DOCUMENT_CREATE2 (if available on your installed version), with the required attributes (this can be master data, classification, custom data...). After this function is called successfully, you should receive the document key (DOKAR, DOKNR, DOKVR, and DOKTL). Which you can also save in the Attachments tab.
    Hope this helps,
    Tudor

  • Calling web services constructed with swaref attachments

    Hi All,
    BPEL has support for attachments, either in MIME or DIME manner.There are attachment examples under BPEL_HOME/samples/demos/Attachment folder.
    Unfortunately, these examples does not cover swaref (Soap with attachment reference) which is widely used for our customers.
    What I would like to ask is:
    Is there any way to call some external systems introducing web services with swaref elements in their interfaces,from BPEL processes?
    When I tried such kind of a web service, I get a remoteFault with summary:
    "Caught exception while handling request: missing cid for attachment"

    If your question is whether a Web service can be accessed from Java by directly progamming on the HTTP level, then the answer is yes.

  • Web Service with attachments (SOAP with attachments) without PI

    Hi,
    Is it possible to send across file(say PDF) using ABAP web services. I know it can be done with Java using SOAP with attachments. Is something similar available for ABAP ? since if we transfer raw binary data as type string / xstring it may have a performance impact.
    I could not see any option for attachments when using web service wizard from SE37 / soamanager
    Note I am not using PI, this Web service would be consumed by a 3rd party tool. There is very little material available on transferring files using web service with SOAP attachments.
    Regards,
    Aditya

    Hi thanks for your input, but did you have to encode your binary data stream in say Base64 / utf-8 ? Also if you are transferring files in bulk(say 10 -100 files)  how does your web  service indicate end of one file or what is the best way so as to avoid performance problems.
    Regards,
    Aditya

  • Future direction of BEA Web Services? - binary / attachments

    Hello,
    I'm looking at needing to transfer binary data through a web service,
    but can't handle the 4/3+ size increase that occurs when embedding the
    data with base64 encoding.
    I know that WL 8.1sp3 support SwA, but that standard is being deprecated
    in favor of newer technologies like Fast Web Services (based on ASN.1
    encoding rules), MTOM/XOP, Basic Attachments Profile.
    We'd prefer to be able to rely on the support of the application server.
    What is BEA's future direction in terms of this technology? Will they be
    supporting one or all of these binary standards? When is the estimated
    date for this technology to be implemented?
    If these technologies won't be implemented for a while, is it possible
    to plug in 3rd party web services solutions into BEA WL8.1 (e.g. Sun's
    JWSDP, Axis, etc)? I believe it is, but am just asking for the sake of a
    full answer.
    Thanks

    Steve,
    Due to BEA's award winning support they offer, I had to figure this out on my own. After weeks of dealing with a support case they provided me with absolutely nothing. Just as they have done in this thread. I will share what I have done for the mean time to get around their limitations using attachments.
    I used the Axis libraries to create a DIME attachment and call a BEA web service. Since BEA doesn't support Dime, a servlet filter had to be implemented and parse the DIME message prior to the web service received it. I'm sending 2GB files with transfer rates of 6MB/S.
    This is a response from BEA's award winning support:
    "We do not have good specification standard as yet as to how to best solve the issue. It appears like a pretty larger issue to solve because of the lack os standards and specification. Engineering is still researching on the issue and we don't know which version will have the fix."

  • Consuming web services with Attachments

    Hello,
    I need to consume a web service with attachements (mime type) from sap was j2ee 7.0 (nw2004s).
    When I try to generate the web service deployable proxy using nwds (version 7.0.06), I get the following error message
    "Invalid WSDL or WSDL not found, please specify different WSDL.."
    Removing references to"wsi:swaRef" from wsdl, above error is not displayd and wsdl is correctly processed
    <complexType name="ArrayOf_tns2_swaRef">
    - <sequence>
      <element maxOccurs="unbounded" minOccurs="0" name="swaRef" nillable="true" type="wsi:swaRef" />
      </sequence>
      </complexType>
    Unfortunately, we have not been able to find any SAP documentation (online help, oss note,,,) describing if SAP WAS Java 7.0 supports this standard.
    Has anybody already worked with Web Services with attachments ?
    Thanks in advace,
    Regards
    Berta

    hi berta,
    http://help.sap.com/saphelp_nw04/helpdata/en/5e/ea656273b74cf386a1f29fc55721fd/frameset.htm
    HTTP error 406 when consuming a Web Service with attachment
    let me know u need any further info
    bvr

  • Web Services with Attachments

    Hello,
    I need to consume a web service with attachements (mime type) from sap was j2ee 7.0 (nw2004s).
    Unfortunately, we have not been able to find any SAP documentation (online help, oss note,,,) describing if SAP WAS Java 7.0 supports this standard, or how to generate ws proxies for consuming these web services.
    Has anybody already worked with Web Services with Attachments ?
    Thanks in advace,
    Regards
    Berta

    hi berta,
    http://help.sap.com/saphelp_nw04/helpdata/en/5e/ea656273b74cf386a1f29fc55721fd/frameset.htm
    HTTP error 406 when consuming a Web Service with attachment
    let me know u need any further info
    bvr

  • Web Services Attachments

    Any advice on the following would be greatly appreciated!
    I am trying to send an attachment to CRMOD via a java web service. I am able to create the message fine in Soap UI so I know the encoding is correct and the structure of the message is correct.
    My java webservice will send the message but all attachments are interpreted as text. The proxy generator I'm using is axis2. The attachment method is calling for a datahandler and i don't know what to feed it (inputstream, outputstream, bytes, string). String works but is only interpreted as a text document. What shoud be the mime type for the datahandler, I've tried application/octet-stream and text/plain.
    I'm using MimeUtility.encode as the encoder but it's cumbersome, is there a better one out there?
    I can provide much more specifics if needed, a snip it would be great as well. I've been working on this for over a week. I can't capture the message from axis2 but the debug objects in eclipse look ok.
    Thanks,
    James

    Hi,
    this is a new WS Interface released in R15 but there are somelimitation
    1. This is exposed only for Activity, you will not find this in other business entity
    2. You can's upload the file by using this, u can use this only for URL attachement.
    Dinesh

Maybe you are looking for

  • Getting ORA-06512: at "SYS.UTL_HTTP", line 1022 ORA-29270: too many open

    hi I am getting the following error while calling the procedure in the batch process ORA-06512: at "SYS.UTL_HTTP", line 1022 ORA-29270: too many open HTTP requests Could you please help me on this? As this is getting affected in the live databases. O

  • An error occurred in the persistence; contact your system administrator

    HI,   when i am going to create user in user administration , it showing this error message      An error occurred in the persistence; contact your system administrator. Post installtion steps i mean visual j2ee admin tool , sld  i configured. every

  • How can I get a list of open web pages in Firefox (in Linux)?

    I would like to know how to get a list of open web pages in Firefox (in Linux), because I have a shortcut to open a web page and I want to get it to see if Firefox has the page open first so that it doesn't open duplicates.

  • Next button not working in advanced table

    HI , I have created an advanced table programatically.everything is working fine but the navigation buttons for next and previous are not working properly.If I click on next 20 records I am getting the first 20 records.Do i need to set anything for t

  • Delete from multiple tables

    Hello guys, Can somebody please help me. I want to delete this one transaction from all the below tables in my testing environment. Can somebody please help me with a script to do that? So basically I want a delete statement for the same select state