Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magento2 SOAP API #2002

Closed
VLCSolutions opened this issue Oct 2, 2015 · 18 comments

Comments

Projects
None yet
6 participants
@VLCSolutions
Copy link

commented Oct 2, 2015

How to create a SOAP API in magento2

@okorshenko okorshenko added the forum label Oct 2, 2015

@okorshenko

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2015

Hi @VLCSolutions , please look at API Documentaion. If you have additional questions, please, let us know

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 2, 2015

If possible could you please elaborate with a example please

@okorshenko

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2015

@VLCSolutions, to create new SOAP API you need to declare interface (for example: https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Api/GroupRepositoryInterface.php) and configure it in webapi.xml (for example: https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/etc/webapi.xml#L12). This logic will be available in REST and SOAP API. For more details please refer Sample WebAPI

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 2, 2015

@okorshenko thanks for reply, where we define the elements or attributes for the request and response elements like how we defined in wsdl.xml file in magento1.
Please bare me...

@okorshenko

This comment has been minimized.

Copy link
Contributor

commented Oct 2, 2015

@VLCSolutions , currently you don't need to configure attributes separately. Your interface returns object (let's say, customer group https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Api/GroupRepositoryInterface.php#L32). \Magento\Customer\Api\Data\GroupInterface has declared getters that will be transformed to response attributes. (https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Api/Data/GroupInterface.php#L20-L23)

@choukalos

This comment has been minimized.

Copy link

commented Oct 5, 2015

the /me means that you only get your information ( authorized with a customer token ) - you can't use that web api to get any other customer from the system like you can with the first web api ( which requires an admin token ).

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 6, 2015

@okorshenko , @choukalos : how to create multiple customers at a time, for example \Magento\Customer\Api\Data\CustomerRepository save method accepts only one customer details at a time to save, but i want to create multiple customers on one API request.

And what is the importance of KEY keyword in api, example https://github.com/magento/magento2/blob/develop/app/code/Magento/Customer/Api/Data/CustomerInterface.php#L35 compared to other attributes which do not have KEY keyword

@choukalos

This comment has been minimized.

Copy link

commented Oct 6, 2015

We only support single entity APIs; there's no plan to support bulk API calls in our framework.

For higher volume integrations we'll be enhancing scheduled FTP's to be more like a feeds system where you can configure scheduled FTP/SFTP transfer via XML as part of your extension. Likely this will be in the later half of 2016. Thinking behind that is it'll allow transfer for very large catalogs, inventory updates, etc in a more performant manner than supporting bulk API calls. This feature will be in enterprise.

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 6, 2015

@choukalos , thanks for reply. Please help me on getting WSDL structure for SOAP API.
Like CustomerRequest able to request from SoapUI.

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 7, 2015

@okorshenko , @choukalos Please help me on getting WSDL XML structure for any API request in magento2. In magento1 i could able to get the WSDL XML structure in SOAPUI or storm by giving SOAP URL, But in magento2 i'm not able to get WSDL XML structure, please help me on this.

@alankent

This comment has been minimized.

Copy link

commented Oct 7, 2015

Are you saying fetching WSDL does not work, or you do not know how to do it? Have you had a look at http://devdocs.magento.com/guides/v2.0/soap/bk-soap.html ? That lists lots of end points for fetching WSDL. If it is not working, could you provide more details on what error messages etc you are getting? Thanks!

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 7, 2015

@alankent I want to get XML request for customerrepository API,
For this i have used http://192.168.0.183/NewMagento2/soap?wsdl&services=customerCustomerRepositoryV1 in SOAPUI tool and i'm getting error

http://192.168.0.183/NewMagento2/soap?wsdl&services=customerCustomerRepositoryV1
loading http://192.168.0.183/NewMagento2/soap?wsdl&services=customerCustomerRepositoryV1
Acquiring the wsdl...
Resolving the wsdlendpoint...
Generating code...
Code generation failed.
Microsoft.FSharp.Core.FailureException: Assembly not yet created.
at Storm.Types.WebSvcManagerOps.clo@90.CreateWebServiceModel()
at <StartupCode$Storm>.$Type.bgworker.run@51@57_2.Invoke(DoWorkEventArgs dArgs)
at <StartupCode$Storm>.$Type.bgworker.run@51@57_1.Invoke(Object sender, DoWorkEventArgs e)
at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

@choukalos

This comment has been minimized.

Copy link

commented Oct 8, 2015

Internally tracking - MAGETWO-43797

@arkadiych

This comment has been minimized.

Copy link
Contributor

commented Oct 23, 2015

@VLCSolutions, I'm trying to reproduce your error. Could you provide more details about the environment, where you ran your XML request: the version of SOAPUI, what kind of tool do you use to generate code, the version of the tool, language of generated code, protocol? Was you able to get results using the approach described in http://www.soapui.org/soap-and-wsdl/getting-started.html with http://192.168.0.183/NewMagento2/soap?wsdl&services=customerCustomerRepositoryV1 ?

@VLCSolutions

This comment has been minimized.

Copy link
Author

commented Oct 26, 2015

@arkadiych Now i'm able to get request and response XML structure from SOAPUI tool, but when i try to use the same http://192.168.0.183/NewMagento2/soap?wsdl&services=customerCustomerRepositoryV1 in storm tool still its giving error.
Note: In Storm magento1 XML Request generated successfully.

@arkadiych

This comment has been minimized.

Copy link
Contributor

commented Nov 4, 2015

@VLCSolutions, looks like Storm supports SOAP1.1, but not SOAP1.2 for code generation. Magento2 SOAP Web Service supports SOAP1.2

@davidalger

This comment has been minimized.

Copy link
Member

commented Nov 10, 2015

Closing issue due to the issue being related to SOAP version incompatibly. Feel free to reopen this if there is a bug in Magento 2, but please provide more details on reproducing the precise issue.

The GitHub issue tracker is intended for technical issues only. Please refer to the Community Forums or Magento Stack Exchange site for technical questions. In your case, the programming questions forum is likely the most appropriate. Feel free to reopen this issue if you think you have encountered a bug in Magento 2.

@davidalger davidalger closed this Nov 10, 2015

@davidalger davidalger removed the bug report label Nov 10, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.