GithubHelp home page GithubHelp logo

goetas-webservices / soap-client Goto Github PK

View Code? Open in Web Editor NEW
175.0 13.0 27.0 287 KB

PHP implementation of SOAP 1.1 and 1.2 client specifications

License: MIT License

PHP 100.00%
soap-client webservice wsdl php soap

soap-client's People

Contributors

bcremer avatar chr-hertel avatar giansalex avatar goetas avatar riccardonar avatar rvdbogerd avatar toilal avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

soap-client's Issues

Release request (0.2.12)

Hey Asmir!

Could you please create a new release, v0.2.12, including my latest configuration change?

Thanks a bunch!
Robbert

Missing symfony/yaml dependency

After installing dependencies with composer install --no-dev the symfony/yaml library is missing. Can be fixed by installing the library manually. This behaviour is not seen this in development since symfony/yaml is required by goetas-webservices/wsdl2php.

Fault Header

Would it be possible to add a dynamic header when a fault exception is raised?

image

About credentials

Sorry I cannot reopen issue #61, I have an additional problem, I cannot generate the metadata because also to access to WSDL during metadata generation needs credentials...

XSD2PHP

The definition "goetas_webservices.xsd2php.schema_reader" has a reference to an abstract definition "logger". Abstract definitions cannot be the target of references.

This error in library why does it appear?

Authentication

Thanks for this nice library. I'd like to use it for a service which requires NTLM authentication. I've looked through the code but I'm not sure I see a way to set the necessary authentication in the config.yml. Could you please provide some documentation for this?

Adding xmlns:xsi XMLSchema-instance

Hi,

I would like to port my SoapClient code to goetas-webservices but I'm running a problem where the server requires xsi:type attribute on the record.
How can I add these type attributes to the generated xml request?

Thanks,
Karoly

SoapFault

It's possible to send soapfault with a 200 OK and not 500?

Serializer Extend

Hi,
Sorry for the question. But I have this metadata yml

Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType:
properties:
hotel:
expose: true
access_type: public_method
serialized_name: Hotel
accessor:
getter: getHotel
setter: setHotel
type: Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\HotelAType
mealPlans:
expose: true
access_type: public_method
serialized_name: MealPlans
accessor:
getter: getMealPlans
setter: setMealPlans
type: array<Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\MealPlansAType\MealPlanAType>
xml_list:
inline: false
entry_name: MealPlan
skip_when_empty: true

This class have this properties:

class HotelMealPlansNotifRSType extends BaseController
{

/**
 * @property \Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\HotelAType
 * $hotel
 */
private $hotel = null;

/**
 * @property
 * \Igm\Synergy\Controllers\Boards\HotelMealPlansNotifRSType\MealPlansAType\MealPlanAType[]
 * $mealPlans
 */
private $mealPlans = null;

}

So far, everything is correct. But this class extends from another: BaseController. I need to exclude the parent's class properties in JMS\Serializer\Metadata\PropertyMetadata Object

With exclude : true, works from the HotelMealPlansNotifRSType but not from the extended properties.

Multiple xml_root_namespace

Hi,
Is it possible to configure several attributes of this type?

For example:

image

In my api we have clients that also send this version of OTA but without the xmls attribute

image

Update JMS Serializer

I hit an issue that seems to be related to JMS Serializer component, but it's locked to version 1.x. (TypeParser is failing to parse \AnyType string).

I try to upgrade soap-client to use JMS Serializer 2.x or 3.x, but unit tests are failing because Serializer::getMetadataFactory() is not available anymore. I have tried to access the factory using Reflection, but it fails latter because the MetadataFactory api seems to have changed.

"Call to undefined method JMS\Serializer\Metadata\PropertyMetadata::setValue()" at
/home/toilal/projects/goetas-webservices/soap-client/src/Arguments/ArgumentsReader.php:87

Generator: Add ability to filter by operation and/or type

Given a large WS definition, with hundreds of operations where one would want to use only a subset, it might be useful to provide a configuration option to the generate command to consider only specific types or types referenced by an operation. I have in mind something similar this package offers: https://github.com/wsdl2phpgenerator/wsdl2phpgenerator#operationnames

In my usecase the generation results in 3000+ classes and 8000+ metadata files. Since it's generated code, and for the sake of auto-completion, maybe I should not care and just commit everything to vcs? On the otherhand, I am able to tell apart which methods I will use. A workaround might be to shorten the wsdl/xsd manually but that seems hacky.

Import schema

Hi,
A question,
When a wsdl has importacions like:
<xsd:import namespace="http://ws.link.hotelresb2b.com/login" schemaLocation="Link?xsd=login.xsd"/>

When I execute the command:
vendor/bin/soap-client -vvv generate config/config_hotusa.yml src/Service/Container --dest-class=Igm/Synergy/Service/Container/SoapContainerHotusa

I've an error in the SchemaReader.php

image

In all the metadata that I have generated with WSDL without imports, I haven't had any problems.

Thanks for advance,
Victor

Operation name in SoapStub class

I have this operation name OTA_HotelRateAmountNotif, it is transformed in oTAHotelRateAmountNotif in SoapStub class.

Inflector::camelize($operation->getName()),

The operation oTAHotelRateAmountNotif isn't find by your Client because it checks the key of operations array only by strtolower in findOperation

if (strtolower($functionName) == strtolower($opName)) {

A solution can be to compile operations array key with same strategy

$operations[$operation->getOperation()->getName()] = $this->generateOperation($operation, $service);

Or is it better to remove the camelize transformation in Stub generator?

SOAP-Envelope

Hi,
If a partner has a webservice with wsdl, but they are the ones who attack us to receive a response it's necessary to perform the soapclient process?

Without soap-envelope I use xsdtophp library to deserialize but when the xml has SOAP-ENV it's more difficult and the response is without soap-envelope too.
Any suggestions @goetas ?
Thanks a lot.

Problem defining multiple inline schemas with the same targetNamespace

Hi! First of all, thanks for all your efforts in trying to make soap work with PHP ๐Ÿ‘ I know it's a pain..

Talking about that, I've been playing (read: debugging) my third party SOAP webservice with your libraries and have the following issues:

The WSDL (2.0) definition that I get from the webservice, has multiple inline schemas with the same targetNamespace. It seems like your schema reader is overwriting it everytime it finds a <xs:schema> line. I looked it up in the WSDL-2.0 spec at http://www.w3.org/TR/wsdl20/ which states:

3.1.2 Inlining XML Schema
...
A WSDL 2.0 document MAY inline two or more schemas from the same targetNamespace. For example, two or more inlined schemas can have the same targetNamespace provided that they do not define the same elements or types. A WSDL 2.0 document MUST NOT define the same element or type in more than one inlined schema.
...

So the desired behaviour is that multiple schema nodes with the same targetNamespace should "extend" each other, not override. I'd like to make PR to make that happen. Before I start, any concerns, thoughts, ideas? :D

Bug in example

Hi!
I've tried to run example script from readme.md section 'Using the client'. Unsuccessfully. I finally got it started.
I had to change:
$metadata = $container->get('goetas_webservices.soap_client.metadata_reader');
to
$metadata = $container->get('goetas_webservices.soap_client.metadata_loader.array');

It's a bug or?

Location to save JMS metadata

Hi,
I have this config.yml:

soap_client: ~
xsd2php:
  namespaces:
    'http://dev.synergy.app/login': 'Igm\Synergy\Login'
    'http://dev.synergy.app/schema': 'Igm\Synergy\Schema'
    'http://dev.synergy.app/exception': 'Igm\Synergy\Exception'
    'http://dev.synergy.app/mealplans': 'Igm\Synergy\Controllers\Mealplans'
  destinations_php:
   'Igm\Synergy\Controllers\Mealplans': src/application/controllers/mealplans
   'Igm\Synergy\Schema': src/application/schema
   'Igm\Synergy\Login': src/application/login
   'Igm\Synergy\Exception': src/application/exception
  destinations_jms:
    'Igm\Synergy\Controllers\MealPlans': metadata/mealplans
    'Igm\Synergy\Login': metadata/login
    'Igm\Synergy\Exception': metadata/exception
wsdl2php:
  metadata:
    '/var/www/igm_xml/include/mealplan.wsdl': ~

The classes generate correctly but I have this error:

Unable to determine location to save JMS metadata for class 'Igm\Synergy\Controllers\Mealplans\SoapEnvelope\Headers\GetMealPlansInput

Problems with Symfony 4.3

I installed the library inside a Symfony 4.3 project using composer. When I run the generate command I get:

In Container.php line 263:

  The "goetas_webservices.wsdl2php.wsdl_reader" service or alias has been removed or inlined when the container was compiled. You should either make it public, or stop using the container directly and use dependency injection instead.


generate [--dest-class DEST-CLASS] [--] <config> <dest-dir>

Tried adding a few things to my services.yaml config but not made it work.

My composer.json is:

{
  "type": "project",
  "license": "proprietary",
  "require": {
    "php": "^7.1.3",
    "ext-ctype": "*",
    "ext-iconv": "*",
    "goetas-webservices/soap-client": "^0.2.8",
    "php-http/guzzle6-adapter": "^1.0",
    "php-http/message": "^1.0",
    "guzzlehttp/psr7": "^1.3",
    "symfony/console": "4.3.*",
    "symfony/dotenv": "4.3.*",
    "symfony/flex": "^1.3.1",
    "symfony/framework-bundle": "4.3.*",
    "symfony/yaml": "4.3.*"
  },
  "require-dev": {
    "goetas-webservices/wsdl-reader": "^0.3.5",
    "goetas-webservices/wsdl2php": "^0.4.3",
    "roave/security-advisories": "dev-master"
  },
  "config": {
    "preferred-install": {
      "*": "dist"
    },
    "sort-packages": true
  },
  "autoload": {
    "psr-4": {
      "App\\": "src/"
    }
  },
  "autoload-dev": {
    "psr-4": {
      "App\\Tests\\": "tests/"
    }
  },
  "replace": {
    "paragonie/random_compat": "2.*",
    "symfony/polyfill-ctype": "*",
    "symfony/polyfill-iconv": "*",
    "symfony/polyfill-php71": "*",
    "symfony/polyfill-php70": "*",
    "symfony/polyfill-php56": "*"
  },
  "scripts": {
    "auto-scripts": {
      "cache:clear": "symfony-cmd",
      "assets:install %PUBLIC_DIR%": "symfony-cmd"
    },
    "post-install-cmd": [
      "@auto-scripts"
    ],
    "post-update-cmd": [
      "@auto-scripts"
    ]
  },
  "conflict": {
    "symfony/symfony": "*"
  },
  "extra": {
    "symfony": {
      "allow-contrib": false,
      "require": "4.3.*"
    }
  }
}

Choose WSDL

Hi,

In this project is posible load wsd or another depending on the url?

Can't make anyType to work with soap-client

I'm consuming a Soap server that has some fields declared as xs:anyType.

There's a note in xsd2php README.md about how to declare custom handlers for those types, but I can't get them to work with soap-client.

Could you provide a short example to make it work ? How to register a custom JMS Serializer handler inside soap client container ?

HTML_ENTITY_DECODE

Hi Goetas,
Thanks for your job.
Is it possible to perform an html_entity_decode with some predeserialize event?
I would not like to do it for all clients that use the api if not only for those that return this type of coding.

CDATA

Hi,
It's possible extract CDATA when XML is generate?
Thanks for advance.

FAULTDETAIL

Hi,

I wanted to see a problem I have about the Fault class.
When a web service returns an object inside the FaultDetail like this:

image

I have seen that a FaultHandler had been created.

What it does is insert the node as a string when it deserializes it:

[detail:Igm\Synergy\SoapClient\Envelope\SoapEnvelope12\Parts\Fault:private] => <ns3:LinkHotelException xmlns:ns3="http://ws.link.test.hotelresb2b.com/exception"><ns3:errorCode>0221</ns3:errorCode><ns3:language>2</ns3:language><ns3:message>The room with this affiliation does not exist in the system.[asdsadsad]</ns3:message></ns3:LinkHotelException>

Is it possible to emulate the behavior of HeaderPlaceHolder to be able to insert any type of object always inside?

How to using your library?

Hi,

I'm trying use your library for source https://gclient.geis.cz/GService/GService.svc?singlewsdl, but I don't know if I have configured it incorrectly or source is not good. Can you explain where I can find error?

My config file:

soap_client:

  namespaces:
    'http://tempuri.org/': 'Soap/GeisClient'
  destinations_php:
    'Geis/Client': src/soap
  destinations_jms:
    'Geis/Client': src/soap/metadata

  metadata:
    'https://gclient.geis.cz/GService/GService.svc?singlewsdl': ~

Command which I run

 vendor/goetas-webservices/soap-client/bin/soap-client generate \
 soap_config.yml \
 --dest-class=Soap/GeisClient \
 src/soap

The result is this error:

In SchemaReader.php line 597:
Can't find type named {http://schemas.datacontract.org/2004/07/GService.Manager}#RequestOfServiceRequestHUsxwOXq, at line 1 in https://gclient.geis.cz/GService/GService.svc?singlewsdl  
In Schema.php line 248:                                                                                                                         
Can't find the Type named {http://schemas.datacontract.org/2004/07/GService.Manager}#RequestOfServiceRequestHUsxwOXq.                                                                                                                         

Thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.